I have touch screen with button. This button has 3 tate ON, OFF, AUTO. State changes it send via MQTT as integer values (0,1,2).
0=OFF
1=ON
2=AUTO
Item config:
String KT_SW_1 “SW 1” (TEST) { mqtt="<[broker:/ESP-BR01/DISPLAY-1/button3:state:MAP(3st.map)]"}
All looks good in logs:
2019-06-24 10:54:19.658 [vent.ItemStateChangedEvent] - KT_SW_1 changed from AUTO to OFF
2019-06-24 10:54:22.923 [vent.ItemStateChangedEvent] - KT_SW_1 changed from OFF to ON
2019-06-24 10:54:26.636 [vent.ItemStateChangedEvent] - KT_SW_1 changed from ON to AUTO
I want to have the same button in UI, I want to change state in UI when press button on device.
Now i have in sitemap:
Switch item=KT_SW_1 mappings=[“OFF”=“OFF”, “ON”=“ON”, “AUTO”=“AUTO”]
i can see 3 button with labels “ON”, “OFF”, “AUTO” in UI
But in logs:
2019-06-24 10:55:55.329 [ome.event.ItemCommandEvent] - Item ‘KT_SW_1’ received command 0
2019-06-24 10:55:55.329 [vent.ItemStateChangedEvent] - KT_SW_1 changed from AUTO to 0
2019-06-24 10:55:59.488 [ome.event.ItemCommandEvent] - Item ‘KT_SW_1’ received command 1
2019-06-24 10:55:59.489 [vent.ItemStateChangedEvent] - KT_SW_1 changed from 0 to 1
2019-06-24 10:56:01.006 [ome.event.ItemCommandEvent] - Item ‘KT_SW_1’ received command 2
2019-06-24 10:56:01.006 [vent.ItemStateChangedEvent] - KT_SW_1 changed from 1 to 2
2019-06-24 10:56:03.390 [ome.event.ItemCommandEvent] - Item ‘KT_SW_1’ received command 1
2019-06-24 10:56:03.391 [vent.ItemStateChangedEvent] - KT_SW_1 changed from 2 to 1
It looks like sitemap convert values according to 3st.map file. How I can:
Receive values as 0,1,2 via MQTT but use ON, OFF, AUTO in logs and rules, able to change state via hardwate button and UI?