This looks to me like an overflown 16-bit integer. I.e. is it possible that outside it was -0.2ºC?
I.e. you might need to additionally interpret the data that you are getting, but you’ll need another thermometer to find a co-relation.
I.e. If you’re getting 6552.0ºC and the other thermometer is showing -1.5ºC then you’re still getting correct data, but you need to do an additional interpretation of it. Check whether the data is below 6280, then it’s a positive temperature, otherwise from the value you’re getting substract 6553.5 and you get the real temperature.
Well can be true - only problem hard to check until spring. But can you provide more details on the possibility to interpret the data? Will test it out straight away
This is one way to interpret it, but you’d have to find what is the co-relation of the number you’re getting from the Modbus sensor, and what the real value is.
Well will try to check it. Now temperature rose to +2 and everything is back to noraml Still seems to me more like a bug in modbus sensor component of HA.
As with the calculations - will have to introduce another sensor.
Default offset will not le me handle this one
Well still a plus temperature so cannot get the abnormal values. Just decided to share some weird code.
Having a modbus unit everything was fine except that i had an input select for fan speeds, slider for temps and they had values like 1 to 5… So i just wanted to get it to look and feel like a climate component. Of course an ideal thing would be to write a custom component, but as my programming skills = 0 had a look around. Generic thermostat component doesn’t have fan control. Fan control doesn’t have temp settigs. So lookis like the only suitable component for an air unit in HA is MQTT HVAC.
So here is how it goes (Please don’t copy it directly as it’s only to show the logic - had to do a lot of renaming into English to show on the forum)
configuration.yaml
climate:
- platform: mqtt
name: Systemair
target_sensor: sensor.rr_temperature
initial: 15
min_temp: 14
max_temp: 19
modes:
- off
- heat
- fan
fan_modes:
- High
- Medium
- Low
- Off
power_command_topic: "systemair/set/power"
mode_command_topic: "systemair/set/mode"
mode_state_topic: "systemair/get/mode"
temperature_command_topic: "systemair/set/temp"
temperature_state_topic: "systemair/get/temp"
fan_mode_command_topic: "systemair/set/fan"
fan_mode_state_topic: "systemair/get/fan"
current_temperature_topic: "systemair/current_temp"
aux_command_topic: "systemair/set/heat"
aux_state_topic: "systemair/get/heat"
And then some rules like
- alias: VSR Fan Set
initial_state: 'on'
trigger:
- platform: mqtt
topic: 'systemair/set/fan'
action:
service: modbus.write_register
data_template:
unit: 1
address: 100
value: >
{% if trigger.payload | string == 'Off' %}
0
{%-elif trigger.payload | string == 'Low' %}
1
{%-elif trigger.payload | string == 'High' %}
3
{% else %}
2
{% endif %}
- alias: VSR Fan Set
initial_state: 'on'
trigger:
- platform: state
entity_id: sensor.vsr_speed_on_control_panel
action:
- service: mqtt.publish
data_template:
topic: "systemair/get/fan"
payload: >
{% if is_state(trigger.to_state.state, "0") %}
Off
{%-elif is_state(trigger.to_state.state, "1") %}
Low
{%-elif is_state(trigger.to_state.state, "3") %}
High
{% else %}
Medium
{% endif %}
Of course would be great to have a highly configurable HVAC component but…
Main question - how to hide the not utilised functions from climate interface? Like swing and Away_mode?
Does anyone else have problems with modbus just dropping out?
Works fine for some time and then suddenly just stops communicating.
A restart of the home assistant service is enough to get it up and running again. (No reboot of the raspberry pi or other stuff.)
I’m using the adapter linked to in the start of this topic.
Example from log file:
2017-12-14 16:30:06 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.reg_hc_temp_in1 fails
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py”, line 199, in async_update_ha_state
yield from self.async_device_update()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py”, line 306, in async_device_update
yield from self.hass.async_add_job(self.update)
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/modbus.py”, line 160, in update
self._count)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/modbus.py”, line 204, in read_holding_registers
**kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/pymodbus/client/common.py”, line 109, in read_holding_registers
return self.execute(request)
File “/srv/homeassistant/lib/python3.5/site-packages/pymodbus/client/sync.py”, line 85, in execute
return self.transaction.execute(request)
File “/srv/homeassistant/lib/python3.5/site-packages/pymodbus/transaction.py”, line 140, in execute
self.client.framer.processIncomingPacket(result, self.addTransaction)
File “/srv/homeassistant/lib/python3.5/site-packages/pymodbus/transaction.py”, line 654, in processIncomingPacket
self._process(callback, error=True)
File “/srv/homeassistant/lib/python3.5/site-packages/pymodbus/transaction.py”, line 679, in _process
result = self.decoder.decode(data)
File “/srv/homeassistant/lib/python3.5/site-packages/pymodbus/factory.py”, line 223, in decode
return self._helper(message)
File “/srv/homeassistant/lib/python3.5/site-packages/pymodbus/factory.py”, line 245, in _helper
response.decode(data[1:])
File “/srv/homeassistant/lib/python3.5/site-packages/pymodbus/diag_message.py”, line 121, in decode
self.sub_function_code, self.message = struct.unpack(‘>HH’, data)
struct.error: unpack requires a bytes object of length 4
Mine is absolutely stable. Check for power consumption on USB. Had this problem with orange pi controlling my projector. USB bluetooth module dropped out. Restarting the service somehow woke it up
Hi! A question about youre modbus USB adapter. I want to do the same thing as you descripe, read temperatur from my system air ventilation. I have a modbus USB adapter. Did you add any resistance in the loop for the RS485 communication? I see in the manual from system air that it should be a 120 ohm resistance at both ends in the loops. But how is this when its onlye one master and one slave? Is it resistance in the USB adapter?
Hi everyone!
Im thinking of implementing this control in my HA setup with our Systemair. Is it still working and is it stable?
If anyone has any advice our inputs Im happy to listen =)
Is the usb to rs485 adapter in the OP still a good choice?
Hi all, i know how to read modbus holding registers in Home assistant from a modbus device, this is working for me. But… there is a way to write that registers from HA to modbus device? I can’t figure out how…
Hi all
I have VSR300 with IAM module which can work as a modbus gateway:
Can anyone guide me how and where to start ? … a’ka small HowTo
The only (and as much) I would like to see current fans’ speeds/mode + would be great to have a possibility to set a working mode (auto,fireplace,fullspeed, holiday etc.) directly from HA.
Hi, I followed a Norwegian guide made for HomeSeer to get up and going. I have two SystemAir units connected to Home Assistant so I may help you if you have any specific questions.