One item, 2 different bindings

Hi @all,

I’ve a question:

I would like to combine the LG TV binding and a HTTP Request to provide an ON/OFF functionality for the TV.

The TV itself has no Ethernet available if switched of. So I built an IR LED to a ESP8266, activated just with a simple HTTP GET.

I would like to have a switch item which sends the HTTP GET, if the TV is switched of (tested with the connstatus item of the TV binding). If the TV is on, the Ethernet command is sufficient.
Therefore, a valid ON/OFF status of the TV is possible.

Could you give me a hint howto configure this kind of item?

Best regards,
Benjamin

Samsung TV’s have the same problems as Ethernet chip is shutdown when TV power is off.

I use network health binding with Samsung TV binding to update state of the item

Switch TV_Livingroom_State { samsungtv=“ON:livingroom:KEY_POWERON, OFF:livingroom:KEY_POWEROFF”, nh=“192.168.1.33” }

How do you deal with switching the TV on if it is in standby?

Best regards

@pauli_anttila I use a second item for network health, because my TV does need nearly a minute to boot up, so I have two items, one for commands, one for real state.

@benjaminaigner just set up the second binding according to the posting of pauli_anttila, so

Switch TV_Livingroom_State { lgtv="OFF:livingroom:POWER", http=">[ON:GET:http://...]" }

lgtv binding will send POWER only if switching to OFF, http binding will send it’s GET if switching to ON…

@Udo_Hartmann
Thank you very much, I think this is the exact solution I need!

@Udo_Hartmann why do you need separate item for network health? Network health binding pings the device by default ones per every minute and update item state accordingly. Frequency can also be changed.

@benjaminaigner

How do you deal with switching the TV on if it is in standby?

I do not in any way. So in that sense my ON command is useless, but doesn’t cause any harm either.

HTTP binding can be used as well, but then you need to use transformation service to convert empty response to OFF and any other response to ON. So network health binding is much more easier to use.

Oh, I don’t. But I can see, if the device was requested to start up (by rule, by UI) and if the device is already online.