Controlling IR Device from webcore


#1

I’m looking into how I can control IR operated devices from webcore. Specifically I have a futronix P800 8 channel lighting scene controller. This lets you set up to 20 pre-set scenes. It has an IR remote control to select the desired scene. I’d like to be able to sent the IR sequence from webcore.

I’ve been looking at the iTach TCP/IP to IR, which looks as though it will allow you to send an http request to its IP to trigger its IR blaster to send the code. I was wondering whether anyone has used this and has an example piston of its use. Having read the documentation I’m a little confused. The device can learn your remote control buttons, but the api seems to need the saved hex string of IR codes, rather than just selecting the learnt button.

Alternatively, are there any other suggestions of devices/methods to achieve this? There seem to some cheaper devices (eg broadlink rm4 mini) designed to work from a phone app, but they also provide ifttt support, but they get mixed reviews and I’m not sure if the delay through ifttt would be too significant.


#2

There was a device I used a while back playing with IR stuff. Let me see if I can find it again, I believe the threads were mostly on ST.

Edit: Wow, this is old… lol

Not sure if I’m remembering this correctly, but once set up, you get an endpoint on the esp8266 that you can trigger with a webcall.


#3

Thanks, that looks interesting, I may look into it, but I’ve not really done any electronics for years.

I was hoping for a simple solution. I’m surprised there are so few commercial solutions available, I would have thought such a device would be very popular. I’m already thinking how it could control the TV & AV amp etc


#4

Yeah, I didn’t do any electronics before, just another googler :slight_smile: Further in that thread is this, my smart dumb receiver…


#5

The Harmony Hub can send IR signals, or even sequence of commands.
(but it is a bit clunky programmatically, and not very snappy)


#6

Thanks, I’ve had a look at the harmony. It looks as though it can connect to ST and control your ST devices. However, I can’t see how you would get ST/webcore to send an IR code from it?

What I’m trying to do, is to send the IR code for scene1 to the futronix lighting controller when the ST kitchen sensor is activated.


#7

If you create an “Activity” in Harmony… then webCoRE can “execute” that activity upon request.
(an “Activity” is basically just a sequence of IR signals with pauses)


#8

Thanks, that sounds as though it should do what I want. In addition, Futronix list the harmony as a compatible device, and there’s a phone app that will work with it too.


#9

Thanks for the suggestion I’ve purchased a Logitech Harmony hub and it all seems to work well. Its not too difficult to set up, but seems a bit awkward picking up new activities, they seem to only appear while you’re in teh smart app and then you have to wait quite a few mins.

An added bonus is the ability to control your ST devices, this can be useful to give other members of the house access, without them having to use the full ST app.

I had trouble adding the harmony smart app, it didn’t appear to be available in the new ST app, and I added through the classic app. (lucky I hadn’t deleted it!)

I see your point about programming, but think its more around the nature of the device e.g only having an IR command to toggle on/off status, so you don’t really know if the device is on or off. For my IR controlled lights, I’m thinking about adding a smart switch so I can monitor the power usage to determine whether they’re on.

I’m wondering whether its possible to write a virtual device handler, although I have no idea how to write one. currently I could have activities to turn on/off and set one of the preset scenes. I can do this with activities, but each activity acts like a switch e.g switch scene1 on/switch scene 1 off. This makes each look like a separate device to WC. Alternatively each activity could just switch the scene on, and a piston would control everything and keep track of whats going on, including turning off the activity (which would have no effect on the light) so it could be triggered again. If all this could be incorporated into a DH with a scene no parameter, similar to a dimmer, it would make the use of the dimmer in WC much easier.


#10

Yes. This is the frustrating part about Harmony.


Other options include using lux to determine if the light is on…

… but perhaps my favorite is to create a Simulated Switch… and then design rules in webCoRE to keep that SimSwitch in sync with the “activity”.

Then, other pistons can just check if SimSwitch is on or off.


#11

I was thinking around the sim switch, but may need several (one for each scene)
I’d like to keep everything in step even if the physical switch is operated manually, although realistically I’ll only know if its on or off. (unless different scenes have very distinct power usages?)

I can add a smart switch as the futronix has its own breaker in the consumer unit, and theres a space where I could install it.


#12

If you are an “outside-the-box” type of thinker, you can “cheat” a bit and use a single Simulated Dimmer to keep track of 99 scenes.

IE:

  • SimDimmer level 10 = Scene Dinnertime
  • SimDimmer level 15 = Scene MovieTime
  • SimDimmer level 20 = Scene MidDay
  • SimDimmer level 25 = Scene OverNight
  • SimDimmer level 30 = Scene Romance
    etc…

Note: This kind of logic requires a bit of note-taking, but it is worth it, IMO.

Also, I would highly encourage to NOT use this SimDimmer as a trigger anywhere… Let it be your display, or used as conditional checks… but do not let any piston trigger off of the level change.

Just my two cents.


Pro Tip:

Levels 1-99 work well, but do not use level 0 or 100…

(I usually reserve “Lvl 1” as my default, or reset, or “no scenes” currently active)


Extreme Pro Tip:

Easier said than done, but if you are successful at “grouping” your scenes, then you will also be able to use conditions like this:

IF SimDimmer's level is between 10 and 20


#13

I like the simDimmer idea, I’ll give it some thought, it will make the device much easier to use in webcore and simplify the pistons controlling the lights.

I’m thinking hard about using the power usage to determine the scene as well. But, suspect given I’ve just replaced all the bulbs with LEDs, that the differences will be difficult to interpret accurately.


#14

Ignoring the power idea for the moment, the easiest way to implement this is…

Whatever piston sets the “scene” of lights…
also sends a command to the SimDimmer to “set level”.

This way, the SimDimmer should always be in sync.


The tricky logic is…
What if the missus manually changes a single light, without touching another scene?
In this case, the SimDimmer will not sync.

If you study family member’s patterns, then you can likely design a piston that automatically resets the SimDimmer back to 1… meaning no full scene in place.


Or, the lazy way, just let SimDimmer represent the LAST scene activated.
(even if a few lights have changed… IE: the full scene is no longer active)

Of course, as soon as the next scene comes into play, the SimDimmer is corrected.


#15

I think my first step is to think out the use cases. The dimmer will be operated manually, its on the wall as you walk into the room and its the main light switch for the room. I can’t think how to fully automate its operation as our movements are not predictable enough. The only predictable activity is going into the room after bed time to fetch a glass of water. At other times I can’t determine whether we’ve gone in for 5 mins to make a drink, an hour to cook a meal, or just sit quietly and watch TV.

I plan to start with your simDimmer idea, then expand it so the simDimmer can operate the lights. I can then look at adding feedback from a smart switch/power meter to correct the simDimmer if the device is operated manually. I suspect this may only cover on or off.

My main concern is being able to tell its off, as I don’t fully trust the IR system to always work.

Another quick question… Looking at the logitech smart app, I’m assuming you can have multiple harmony hubs? I’m tempted to get one for the living room to turn all the AV kit off after “goodnight” although having added my devices to the existing hub, only the LG TV has distinct on & off commands, so it may prove difficult to know the state of the other devices to power them off. But thats another thread!


#16

This segment can actually be quite tricky…
I would highly recommend using only one of the following:

  • Using the SimDimmer as the endpoint display… and keeping it in sync… -OR-
  • Using the SimDimmer as the master light controller…

It is not so easy to create logic where a lowly endpoint can also be the master…
(Think of the hierarchy… are you doing what I say, or am I doing what you say?!?)

If you really want to use both concepts, I would create two SimDimmers then. One to force control (that will NOT stay in sync), and another “dumb” SimDimmer, that’s whole purpose is to stay in sync and display.

Note: You can have multiple “masters”, or ways to trigger the scenes… I am just trying to discourage planning for the lowly endpoint (which should be ‘dumb’, and simply waiting for status updates) to also push (force) commands back out. (which could trigger yet another change… repeat ad infinitum)


Understandable… Does the IR devices allow for a “Turn off” command? Or are you forced to send blind “Toggle” commands?

If you can send a “Turn off” command, one trick to help with missed commands is something like this:

With device
    Turn off
    Wait 1 sec
    Turn off
END WITH

Yes, it is bit of a hack, but as you know, IR is not 100% reliable. This little exta code helps to ensure that the device is truly off.

Unfortunately, if you can only send “toggle” commands, this trick will not work for you.


Yes, but whenever possible, I would keep logic out of the Harmony.
(I treat it like IFTTT… IE: Decent, but only used as a last resort when nothing else will work)