Global Caché Binding rules not working

(Régis Saint Girons) #1

I want a rule to Power On my Sony TV, controlled by a Global Caché ItachIR device, when I say “Alexa Télé”.

As explained in the Global Caché Binding doc I have the following configuration:

.items
String SonyTV {channel=“globalcache:itachIR:000C1E0248C0:ir_m1#c3”}

.map
SonyTV_PowerOn = 40000,4,1,96,24,24,24,48,24,48,24,48,24,24,24,48,24,24,24,48,24,24,24,24,24,24,24,24,1013

.rules
rule “TV” //Power On TV on “Alexa Télé” voice command
when
Item amazonechocontrol_echoshow_e5e78250_G000WV069115071C_lastVoiceCommand changed to “télé”
then
SonyTV.sendCommand(“SonyTV_PowerOn”)
end

The rule starts on Alexa voice command but with no PowerOn action on the TV.

I have the following log:

18:43:09.706 [INFO ] [smarthome.event.ItemStateChangedEvent] - amazonechocontrol_echoshow_e5e78250_G000WV069115071C_lastVoiceCommand changed from to télé
18:43:09.768 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘SonyTV’ received command SonyTV_PowerOn
18:43:09.784 [INFO ] [arthome.event.ItemStatePredictedEvent] - SonyTV predicted to become NULL

For information when I am replacing in the rule ‘SonyTV’ by ‘globalcache_itachIR_000C1E0248C0_ir_m1_c3’ it works and that is an OK workaround but I am trying to learn how to properly use OpenHab and I would like to understand why the SonyTV item approach does not work.

Any help is welcome

0 Likes

(Rossko57) #2

So it’s the MAPping that isn’t working? You may need to share your .map filename, location, and the thing configuration pointing to the map

0 Likes

(Régis Saint Girons) #3

I have shared the map file details in the global caché binding and it is working because SonyTV_PowerOn is properly mapped with the IR codes (the TV does power on) when using this action in the rule
globalcache_itachIR_000C1E0248C0_ir_m1_c3.sendCommand(“SonyTV_PowerOn”)
log : 12:11:18.797 [INFO ] [arthome.event.ItemStatePredictedEvent] - globalcache_itachIR_000C1E0248C0_ir_m1_c3 predicted to become SonyTV_PowerOn

But it is not working when using the ‘SonyTV’ item
SonyTV.sendCommand(“SonyTV_PowerOn”)
log: 18:43:09.784 [INFO ] [arthome.event.ItemStatePredictedEvent] - SonyTV predicted to become NULL

0 Likes

(Rossko57) #4

Alright, so this auto generated Item globalcache_itachIR_000C1E0248C0_ir_m1_c3 does what you expect, and your defined Item SonyTV does not.

You should compare the Items, especially the channel(s) that they link to.

0 Likes

(Mark) #5

This should be ir-m1, not ir_m1

0 Likes

(Régis Saint Girons) #6

Thanks Mark, it works. That was so stupid of me…

0 Likes

(Mark) #7

No worries. It’s an easy detail to miss. Glad you’re up and running!

0 Likes

(Régis Saint Girons) #8

Still learning but enjoying it a lot. Thanks to all for this great work

0 Likes