Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT: valueerror converting string to float #3191

Closed
indexample opened this issue Aug 24, 2023 · 2 comments
Closed

MQTT: valueerror converting string to float #3191

indexample opened this issue Aug 24, 2023 · 2 comments

Comments

@indexample
Copy link

Describe the issue you are experiencing

my core log gives the following error:

ValueError: Sensor sensor.system_uptime has device class 'None', state class 'measurement' unit 'None' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: '000+03:58:02.016' (<class 'str'>)

and this seems due to not converting a string "timevalue"? to float

2023-08-24 13:36:07.284 ERROR (MainThread) [homeassistant.components.mqtt.models] Exception raised when updating state of sensor.system_uptime, topic: 'ems-esp/heartbeat' with payload: b'{"bus_status":"connected",**"uptime":"000+03:56:02.014"**,"uptime_sec":14162,"ntp_status":"on","rxreceived":10200,"rxfails":3,"txreads":2159,"txwrites":0,"txfails":0,"mqttcount":3791,"mqttfails":0,"apicalls":0,"apifails":0,"sensorreads":0,"sensorfails":0,"freemem":149,"rssi":-42,"wifistrength":100}'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 593, in state
    numerical_value = float(value)  # type:ignore[arg-type]
                      ^^^^^^^^^^^^
**ValueError: could not convert string to float: '000+03:56:02.014'**

What type of installation are you running?

Home Assistant Supervised

Which operating system are you running on?

Debian

Which add-on are you reporting an issue with?

Mosquitto broker

What is the version of the add-on?

6.2.1

Steps to reproduce the issue

  1. (re)start HA

System Health information

System Information

version core-2023.8.3
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.4
os_name Linux
os_version 5.10.0-23-amd64
arch x86_64
timezone Europe/Amsterdam
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4927
Installed Version 1.32.1
Stage running
Available Repositories 1266
Downloaded Repositories 3
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Debian GNU/Linux 11 (bullseye)
update_channel stable
supervisor_version supervisor-2023.08.1
agent_version 1.2.2
docker_version 24.0.2
disk_total 883.7 GB
disk_used 45.6 GB
healthy failed to load: Unhealthy
supported failed to load: Unsupported
supervisor_api ok
version_api ok
installed_addons Duck DNS (1.15.0), File editor (5.6.0), Samba share (10.0.2), deCONZ (6.20.0), MariaDB (2.6.1), AdGuard Home (4.8.14), ESPHome (2022.3.1), Mosquitto broker (6.2.1), UniFi Network Application (2.7.0), Nginx Proxy Manager (0.12.3), Uptime Kuma (0.8.0)
Dashboards
dashboards 3
resources 2
views 9
mode storage
Recorder
oldest_recorder_run July 18, 2023 at 8:27 AM
current_recorder_run August 24, 2023 at 1:35 PM
estimated_db_size 589.81 MiB
database_engine mysql
database_version 10.6.12
Spotify
api_endpoint_reachable ok

Anything in the Supervisor logs that might be useful for us?

No response

Anything in the add-on logs that might be useful for us?

Logger: root
Source: /usr/src/homeassistant/homeassistant/bootstrap.py:399
First occurred: 1:35:42 PM (1 occurrences)
Last logged: 1:35:42 PM

Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.11/site-packages/RFXtrx/__init__.py", line 986, in _connect
    self.transport.reset()
  File "/usr/local/lib/python3.11/site-packages/RFXtrx/__init__.py", line 832, in reset
    self.send(b'\x0D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
  File "/usr/local/lib/python3.11/site-packages/RFXtrx/__init__.py", line 828, in send
    self.serial.write(pkt)
    ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'write'

Additional information

No response

@darkxst
Copy link
Contributor

darkxst commented Aug 25, 2023

This would not be caused by the Mosquitto addon. It is likely an issue with ems-esp and needs to be fixed there.

@agners
Copy link
Member

agners commented Sep 1, 2023

As darkxst says, this is Home Assistant Core related. Maybe home-assistant/core#93071 helps?

Check the issue reports in Core and if you still think there is a problem in Home Assistant please report it in the linked repository.

@agners agners closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants