Closed machineglow closed 3 years ago
Hi,
If fetch is set to cached, no script is called. Polled is probably what you want.
TTFN, John
On Mon, Mar 1, 2021 at 8:31 PM machineglow notifications@github.com wrote:
Assigned #99 https://github.com/ztalbot2000/homebridge-cmd4/issues/99 to @ztalbot2000 https://github.com/ztalbot2000.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/99#event-4393061785, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX64LWS7CA373ZOKODDTBQ5VJANCNFSM4YNXMQLQ .
Fetch:Always - for every characteristic get from device. Fetch:Cached- For every characteristic get from cache. Fetch:Polled- Get from cache all characteristics, except those that are polled.
On Mon, Mar 1, 2021 at 8:33 PM John Talbot ztalbot2000@gmail.com wrote:
Hi,
If fetch is set to cached, no script is called. Polled is probably what you want.
TTFN, John
On Mon, Mar 1, 2021 at 8:31 PM machineglow notifications@github.com wrote:
Assigned #99 https://github.com/ztalbot2000/homebridge-cmd4/issues/99 to @ztalbot2000 https://github.com/ztalbot2000.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/99#event-4393061785, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX64LWS7CA373ZOKODDTBQ5VJANCNFSM4YNXMQLQ .
Thanks!. That seemed to have worked. Not sure how it worked before. if fetch cached is basically like fetch always except for polled characteristics, haven't I explicitly defined my switch as polled?
edit: nm, i think i understand it now... Not sure how it was working before but oh well.. =/
Hi, I'll close this as it's working again. The three rules I listed above hold true. Believe me, I struggled a lot with this too. Your statement,"if fetch cached is basically like fetch always except for polled characteristics" I might have thought so at one time, but it is problematic for a very specific case of Current/Target characteristics. A set of a Target characteristic has to return immediately the Current value. If so it would be the wrong Cached characteristic value. Hence the three rules of:
Fetch:Always - for every characteristic get from device. Fetch:Cached- For every characteristic get from cache. Fetch:Polled- Get from cache all characteristics, except those that are polled.
Question, not really related. Are you using Homebridge-Config-UI-X? They are not showing my CHANGELOG and other documentation properly. Clicking inline links closes the window. I put a bug report in with them. I was just wondering as you had said you were waiting for things to resolve.
I'll close this now as resolved but we can still chat.
ttfn, John
Hi,
I have a switch controlled by state_cmd that no longer working after various updates. I upgraded homebridge and cmd4 over the last few weeks hoping this would get fixed but it's still not working. I must be doing something wrong. Strange thing is, it was working great before hand and I haven't changed/modified the state_cmd script.
I have a simple switch that's controlled by a state_cmd script that queries something (airplay state) and spits back 1 or 0 depending on whether something is airplaying.
It was working for a while but a recent update/change broke it somehow. The script still spits out 1 or 0 but the switch in the home app seems to be set independently and doesn't respect the state_cmd script output. I have a feeling there was a change to the json or the way the script was called and I'm just not aware of it.
Here's the config.json:
Here's the script:
Here's the script in action when I stop airplay.:
Environment:
Thanks!!