justme-1968 / homebridge-fhem

a fhem platform plugin for homebridge
https://wiki.fhem.de/wiki/Homebridge_einrichten
79 stars 16 forks source link

Parameter nocache dosnt work with Homematic HM-CC-RT-DN #30

Open svenson08 opened 7 years ago

svenson08 commented 7 years ago

With current mapping TargetTemperature and CurrentTemperature don't use cached value from fhem.

homebridgeMapping TargetTemperature=desired-temp::desired-temp,minValue=5,maxValue=35,minStep=0.5,nocache=true
                    CurrentTemperature=BZ_Heizung_01_Clima:measured-temp,nocache=true
                    StatusLowBattery=BZ_Heizung_01:battery,values=ok:BATTERY_LEVEL_NORMAL;;/^.*/:BATTERY_LEVEL_LOW
                    TargetHeatingCoolingState=heatingState,values=OFF:0;;HEAT:1;;COOL:2;;AUTO:3,cmds=OFF:controlManu+off;;HEAT:controlMode+boost;;AUTO:controlMode+auto;;COOL:controlManu+17.0
                    CurrentHeatingCoolingState=heatingState,values=OFF:0;;HEAT:1;;COOL:2;;AUTO:0

the output of homebridge looks

2017-02-15 18:49:15 caching: BZ_Heizung_01_Clima-desired-temp: 21.0
[2/15/2017, 6:49:15 PM] [FHEM]     caching: TargetTemperature: 21 (as number; from '21.0')
2017-02-15 18:49:15 caching: BZ_Heizung_01_Clima-measured-temp: 23.1
[2/15/2017, 6:49:15 PM] [FHEM]     caching: CurrentTemperature: 23.1 (as number; from '23.1')

the value from TargetTemperature and CurrentTemperature use caching. In any HomeKit App I see the stored value, which does not correspond to the current correct value

friko21 commented 7 years ago

I have also issues with cached values. Can't homebridge use the values stored in them? Is it possible to deactivate caching for all devices in the config part for this plugin?

justme-1968 commented 7 years ago

maybe there is a bug with nocache in the current version. i will check.

but nocache should not be used generally. it slows everything down as the roundtrip from homebridge to fhem and back does take some time that summs up to quite a huge amount if homekit is requesting the status for a whole room.

it is useful only for thinks like sonos players where the volume is not generating an event by default. and even there it is better to configure the sonos device to generate the event.

homebridge-fhem uses the events that fhem sends to cache current values. so it should always have correct values.

if there is a problem please do the following: