steilerDev / homebridge-openhab2-complete

A homebridge plugin for openHAB, that has the expectation to fully support all Services offered by Apple's Homekit Accessory Protocol (HAP)
GNU General Public License v3.0
52 stars 16 forks source link

Value ON for dimmer #43

Closed grzegorz914 closed 4 years ago

grzegorz914 commented 4 years ago

Describe the bug If pressing light button in HomeKit app the send values for dimmer are OFF/0 or 99, why not send ON/100 value?

Right now openHAB2 supports for dimmer ON/OFF and value 0-100 Also right now OH2 report value 100 for dimmer and rollershutter.

Expected behavior Send ON/100 and OFF/0 if button press.

Configurations config.json

{
                    "name": "Kuchnia meble",
                    "type": "light",
                    "item": "KuchniaMebleDimmer"
},

openhab2.items

Dimmer    KuchniaMebleDimmer
Dimmer    PLC_KuchniaMebleDimmer   "Kuchnia blat ściemniacz"    <dimmer>    (SciemniaczParter) { simatic="plc:DB26.DBB44:byte" }
Switch   PLC_KuchniaMebleSwiatlo    "Kuchnia blat światło" <light>    (SwiatloParter, SwiatloParterAktywne, Swiatlo)  { simatic="plc:Q21.1:byte" }

Logs:

2019-08-25 11:02:01.278 [ome.event.ItemCommandEvent] - Item 'PLC_KuchniaMebleTaster' received command ON
2019-08-25 11:02:01.281 [vent.ItemStateChangedEvent] - KuchniaMebleDimmer changed from 0 to 99
2019-08-25 11:02:01.282 [ome.event.ItemCommandEvent] - Item 'PLC_KuchniaMebleTaster' received command OFF
2019-08-25 11:02:02.256 [vent.ItemStateChangedEvent] - PLC_KuchniaMebleSwiatlo changed from OFF to ON
2019-08-25 11:02:02.257 [vent.ItemStateChangedEvent] - KuchniaMebleDimmer changed from 99 to 25
2019-08-25 11:02:12.521 [ome.event.ItemCommandEvent] - Item 'KuchniaMebleDimmer' received command OFF
2019-08-25 11:02:12.527 [vent.ItemStateChangedEvent] - KuchniaMebleDimmer changed from 25 to 0
2019-08-25 11:02:12.530 [ome.event.ItemCommandEvent] - Item 'PLC_KuchniaMebleTaster' received command ON
2019-08-25 11:02:12.533 [ome.event.ItemCommandEvent] - Item 'PLC_KuchniaMebleTaster' received command OFF
2019-08-25 11:02:14.818 [vent.ItemStateChangedEvent] - PLC_KuchniaMebleSwiatlo changed from ON to OFF

Environment (please complete the following information):

Thanks

grzegorz914 commented 4 years ago

45 fixed the issue

steilerDev commented 4 years ago

Merged your pull request, should be fixed now?

grzegorz914 commented 4 years ago

Yes, it working as expected

2019-09-14 21:14:28.114 [ome.event.ItemCommandEvent] - Item 'JadalniaKinkietyDimmer' received command ON
2019-09-14 21:14:28.124 [vent.ItemStateChangedEvent] - JadalniaKinkietyDimmer changed from NULL to 100
2019-09-14 21:14:28.134 [ome.event.ItemCommandEvent] - Item 'PLC_JadalniaKinkietyTaster' received command ON
2019-09-14 21:14:28.138 [ome.event.ItemCommandEvent] - Item 'PLC_JadalniaKinkietyTaster' received command OFF
2019-09-14 21:14:33.488 [vent.ItemStateChangedEvent] - PLC_JadalniaKinkietySwiatlo changed from OFF to ON
2019-09-14 21:14:33.506 [vent.ItemStateChangedEvent] - JadalniaKinkietyDimmer changed from 100 to 40
2019-09-14 21:14:43.540 [ome.event.ItemCommandEvent] - Item 'JadalniaKinkietyDimmer' received command OFF
2019-09-14 21:14:43.548 [vent.ItemStateChangedEvent] - JadalniaKinkietyDimmer changed from 40 to 0
2019-09-14 21:14:43.552 [ome.event.ItemCommandEvent] - Item 'PLC_JadalniaKinkietyTaster' received command ON
2019-09-14 21:14:43.556 [ome.event.ItemCommandEvent] - Item 'PLC_JadalniaKinkietyTaster' received command OFF
2019-09-14 21:14:48.859 [vent.ItemStateChangedEvent] - PLC_JadalniaKinkietySwiatlo changed from ON to OFF