- Code: Select all
dev.updateStateOnServer(key='sensorValue', value = baseValue, decimalPlaces=1, uiValue=str(baseValue) + u' °C')
dev.updateStateOnServer("displayState", str(varValue), uiValue=str(varValue) + u' °C')
dev.updateStateOnServer("displayState", str(varValue), uiValue=str(varValue) + u"\u00b0F")
The second line is my version - which throws the following error:
The third line is @CliveS's suggested fix - which also throws the following error:
- Code: Select all
SyntaxError: ("(unicode error) 'utf8' codec can't decode byte 0xb0 in position 0: invalid start byte",
('plugin.py', 109, None, 'dev.updateStateOnServer("displayState", str(varValue), uiValue=str(varValue) + u" \xb0C")\n'))
I've played with ' and with " in the commands in case it makes a difference, but I definitely don't have Smart Quotes involved.
Peter