Community
OpenEnergyMonitor

Community

WiFi MQTT Control Relay Thermostat and Redis

Hy, everybody,

I’m trying to play with WiFi MQTT Control Relay Thermostat
(https://guide.openenergymonitor.org/integrations/mqtt-relay/) and I don’t know how to fill
the Redis.

Python give me an error :
"Traceback (most recent call last):

  • File “cuns.py”, line 14, in *
  • heating[‘schedule’] = json.loads(r.get(“app/heating/schedule”))*
  • File “/usr/lib/python3.7/json/init.py”, line 341, in loads*
  • raise TypeError(f’the JSON object must be str, bytes or bytearray, '*
    TypeError: the JSON object must be str, bytes or bytearray, not NoneType
    "
    because redis is empty.

someone can help me ?

nb:sorry for my poor english.

made many corrections in this old project, I’m hanging on.

Thanks @fr3d what are the corrections that you have made? Are you fixing issues with: https://github.com/openenergymonitor/ESP8266_Relay_Board/tree/master/1ch_relay?

currently I’m not playing with esp8266,
I don’t have any linux system on pc. I’ve only got few raspberrys but I think they can’t get the xtensa i386 library

.So I’m trying to convert this project (https://github.com/emoncms/development/tree/master/experimental/control/open_thermostat_scheduler) into raspberry. I would like to add and choose differents room with mqtt T° sensors

For now I can’t find the json structure to fill redis schedule.

 *File "duns.py", line 14, in <module>*
*    heating['schedule'] = json.loads(r.get("app/heating/schedule"))*
*  File "/usr/lib/python3.7/json/__init__.py", line 348, in loads*
*    return _default_decoder.decode(s)*
*  File "/usr/lib/python3.7/json/decoder.py", line 337, in decode*
*    obj, end = self.raw_decode(s, idx=_w(s, 0).end())*
*  File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode*
*    raise JSONDecodeError("Expecting value", s, err.value) from None*
*json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1)*

regards…