[SOLVED] Sitemap visibility for strange value

I recently setup zwave2mqtt and my values for my thermostat Mode coming now like
“Cool” and “Heat”

Which is fine, however, I seem to have run in to an issue with the visibility in my sitemap. I am trying to have the temperature value for CoolSet only when the HVAC_Mode=“Cool”

Setpoint item=HVAC_CoolSetPoint visibility=[HVAC_Mode=="\"Cool\""] icon="heating" minValue=68 maxValue=78 step=1

Currently configured with the above, but that doesn’t work. If i do ==“Cool” that doesn’t seem to do it either. Wondering if there is an issue with escaping quotes in the visibility?

Wondering if anyone else has seen this.

And what is the state of `HVAC_Mode" exactly?
Can you show the log of when it changes value, please

1 Like

“Cool”

or

“Off” ect. I think that’s where I am running in to issues

Again:

Also, you item definition, thanks

I’d at least add a temporary sitemap line to show the Item state at issue, as it arrives at the UI

Text item=HVAC_Mode label="hvac mode [%s]"
1 Like

added the following

Text item=HVAC_Mode label="HVAC_Mode = [%s]"

shows up now as

image

Well, there are quotemarks and quotemarks. Still like to see what appears in your events.log

Roger that :slight_smile:

2020-01-13 20:37:47.150 [ome.event.ItemCommandEvent] - Item 'HVAC_Mode' received command "Off"
2020-01-13 20:37:47.151 [nt.ItemStatePredictedEvent] - HVAC_Mode predicted to become "Off"
2020-01-13 20:37:47.153 [vent.ItemStateChangedEvent] - HVAC_Mode changed from "Cool" to "Off"
2020-01-13 20:37:47.154 [ome.event.ItemCommandEvent] - Item 'HVAC_Mode' received command "Off"
2020-01-13 20:37:47.157 [nt.ItemStatePredictedEvent] - HVAC_Mode predicted to become "Off"
2020-01-13 20:37:49.727 [vent.ItemStateChangedEvent] - HVAC_Mode changed from "Off" to "Cool"
2020-01-13 20:37:52.180 [vent.ItemStateChangedEvent] - HVAC_Mode changed from "Cool" to "Off"
2020-01-13 20:38:10.919 [ome.event.ItemCommandEvent] - Item 'HVAC_Mode' received command "Cool"
2020-01-13 20:38:10.920 [ome.event.ItemCommandEvent] - Item 'HVAC_Mode' received command "Cool"
2020-01-13 20:38:10.921 [nt.ItemStatePredictedEvent] - HVAC_Mode predicted to become "Cool"
2020-01-13 20:38:10.922 [nt.ItemStatePredictedEvent] - HVAC_Mode predicted to become "Cool"
2020-01-13 20:38:10.929 [vent.ItemStateChangedEvent] - HVAC_Mode changed from "Off" to "Cool"

I am wondering if i should just use a js transform. That way I can strip off the quotes. Also going going to open an issue on the zwave2mqtt to see if there is a reason that the values have to come across with quotes.

In the zwave2mqtt config, there are a couple options.

according to the documentation examples.

So it seems that when it sends any string it will come across with the quotes. Which I guess makes sense as we have all done our programming and know strings for the most part get wrapped in " or '.

Soo. with that being said. If it’s switched to json timed value. I wonder if it would still come in with quotes… guess im testing that next. If that doesn’t work. Maybe the best option will be to just do a js transform that strips the quotes and returns the raw value.

Seems like alot to get a sitemap items to show lol

Maybe so.
I wouldn’t be surprised if there is a limitation/bug in visibilty handling text with included quotes.

The only other thing to wonder about is if \ is really the escape character for sitemaps (if they even have one)

1 Like

Well, I know it does… just maybe not in the visibility.

Since i have it seems to want me to send “Cool” anyway. I have the following for mappings

Switch item=HVAC_Mode mappings=["\"Off\""="Off","\"Cool\""="Cool","\"Heat\""="Heat"]

and that sends OFF as “OFF” and Cool as “Cool”

but that same format did not seem to work for visibility.

1 Like

Ok, so quick update. I did switch to doing the JSON-TimeValue combination. added the following transform to all things coming in from the zwave2mqtt.

,transformationPattern="JSONPATH:$.value"

Everything seems good now. I updated my site maps to take out the extra quotes. Added my visibility thing in. Now my temperature set value is only shown when the AC is on.