mrk-its / can2mqtt

Apache License 2.0
41 stars 5 forks source link

Wrong sensor values #5

Closed max-fx closed 1 year ago

max-fx commented 1 year ago

Hi Mariusz, after code update on esp32 and canmqtt today, there are transmitted wrong sensor value. There are changes in configuration?

can2mqtt_log: 2023-05-14 11:26:43 Master canopen.variable DEBUG Value of states.state (0x2011:1) is 48 2023-05-14 11:26:43 Master can2mqtt.entities DEBUG MQTT publish topic: esphome/can_state_002_20110100 value: 48 - ok 2023-05-14 11:26:43 Master can2mqtt.entities DEBUG recv mqtt topic: esphome/can_state_002_20110100 b'48' 2023-05-14 11:26:44 Master canopen.nmt DEBUG Received heartbeat can-id 1794, state is 5 2023-05-14 11:26:53 Master canopen.variable DEBUG Value of states.state (0x2011:1) is 32 2023-05-14 11:26:53 Master can2mqtt.entities DEBUG MQTT publish topic: esphome/can_state_002_20110100 value: 32 - ok 2023-05-14 11:26:53 Master can2mqtt.entities DEBUG recv mqtt topic: esphome/can_state_002_20110100 b'32' 2023-05-14 11:26:55 Master canopen.nmt DEBUG Received heartbeat can-id 1794, state is 5

esphome_log: [11:26:43][D][htu21d:065]: Got Temperature=24.2°C Humidity=48.4% [11:26:43][D][sensor:110]: 'Temperatur_1': Sending state 24.24667 °C with 1 decimals of accuracy [11:26:43][D][sensor:110]: 'Luftfeuchtigkeit_1': Sending state 48.43573 % with 1 decimals of accuracy [11:26:43][D][canbus:033]: send extended id=0x182 rtr=FALSE size=4 [11:26:44][D][canbus:033]: send extended id=0x702 rtr=FALSE size=1 [11:26:53][D][htu21d:065]: Got Temperature=24.3°C Humidity=48.4% [11:26:53][D][sensor:110]: 'Temperatur_1': Sending state 24.26813 °C with 1 decimals of accuracy [11:26:53][D][sensor:110]: 'Luftfeuchtigkeit_1': Sending state 48.37469 % with 1 decimals of accuracy [11:26:53][D][canbus:033]: send extended id=0x182 rtr=FALSE size=4 [11:26:55][D][canbus:033]: send extended id=0x702 rtr=FALSE size=1 esphome_config: ` canopen: id: can_gate canbus_id: can_bus node_id: 2 entities:

mrk-its commented 1 year ago

Thanks, will take a look. It is possible it is caused by this commit: https://github.com/mrk-its/esphome-canopen/commit/48d091f91269083290010dfcc415785f4ef4cc75