MV 2 Umbrellas - Can someone tell me if this is...
Can someone tell me if this is possible ? ... have a custom path ... have one client trigger a put to change the value at that path ... have another client subscribe to that path and be notified when the value changes?
7 Replies
There’s lots of stuff that works this way. Digital switching is probably the most common. Just note that “subscribing” to a path is something different.
What are you actually trying to achieve - what is your use case?
would like an esp32 based client to know when a value changes so it can toggle a relay
ah looks like "subscribing" may be more of a signalk plugin thing to allow a plugin to be notifified of data changes
Any client can subscribe to be notified when something changes. That’s different from being notified when something requests a change to be made.
For example, a display subscribes to autopilot target heading so that it can show the value.
Now when the user wants to change the autopilot heading, a PUT request is sent for that path. Only the autopilot gets that, changes the target heading, then sends out a delta with the new heading. The display gets that and updates the screen.
Not every path supports PUT requests. For example, wind speed, that’s “read only”.
thanks Scott ... that is very helpful info ! for a custom path it seems like you would be able to define if the data is RO or RW?
There is currently no way to do that.
If you try to PUT to a path that does not support it, you will get an error response.