Sensorpush humidity and temperature sensors

With the latest Home Assistant release 2022.07 they changed unit handling to allow setting preferred units for for various measurements (including temperature). Home Assistant will make sure all values are in preferred unit…however, I cannot find where to set this.

AHA! I see this only applies to weather integrations so far, hopefully, in the next release they will extend this to other temperature sensing devices! (this applies to all sorts of values including weights, speeds, pressure, etc).

@ZyberSE not sure what changed, but I think HA was doing some auto conversion previously perhaps? The SensorPush API/client only supports values in Fahrenheit currently, so conversion must have been happening somehow in HA.

I’m not a py dev but I see you’re taking into account which unit system that’s set and also converting min/max values to C if needed?
Any chance to implement internal conversion on the sensor value too?

Home Assistant itself is working on auto-conversion of unit systems so that integrations don’t have to (and really the integrations should not have to).

I don’t know why HA 2022-07 release changed this to no longer auto-convert to Celsius. There must be a setting in HA to resolve this?

I don’t the SensorPush unit_system setting actually does anything.

I think that the integration must be adjusted to support this, see developers.home-assistant/blog/2022-06-14-number_entity_refactoring.md at aeab05eae7719a6d61a18718b25855974735d1bc · home-assistant/developers.home-assistant · GitHub

Temperature conversion will automatically be done for number entities with device class set to temperature to the temperature unit configured by the user.

To make this possible, custom component integrations should be updated to override properties native_max_value, native_min_value, native_step, native_unit_of_measurement, native_value instead of max_value, min_value, step, unit_of_measurement, value and to override methods async_set_native_value and set_native_value instead of async_set_value and set_value.

This PR implemented this change for a number of core integrations. I have Shelly HTs which report temperatures, and their temperature entities have the new temperature unit conversion, so it’s not restricted to weather integrations.

If I have time I’ll work on implementing this later this week. It should be a simple change (famous last words)

Quick update: I have gotten the above to work, with HA providing the option to select a unit of measurement for the temperature, and doing the conversion accordingly. I need to clean up the code, but I hope to get a PR out this evening.

It looks like the SensorPush API and/or pysensorpush always returns imperial measurements, so I can strip the metric/imperial logic out of the integration, and update the integration to use the new unit systems, and HA will handle everything.

One side effect of removing the conversions from the integration is that HA will have to support converting barometric pressures. I don’t know if it does now, and I don’t have a sensor that supports this currently so I can’t test it.

I just submitted a PR for the above changes. I know that technically I can just hit merge, but I’d appreciate a code review all the same :grinning_face_with_smiling_eyes: @ryans are you up for a PR review?

Update (because apparently you cannot make more than 3 consecutive uninterrupted replies) : that PR was merged and version 1.0.4 is available which should resolve the Celsius problems @ZyberSE and others had.

1 Like

I can confirm it’s working as expected now nice!

For a few days I had template sensors that did the conversion, but with 1.0.4 it’s not necessary any more.

Hey all…

Is there a way to install this manually? I run HA inside of a docker environment (running on a NAS) and would love to get this added.

I tried adding the Sensor Push integration that is shown within HA, but it just tells me it can’t find any devices and then fails to install. This is without it asking me about accounts, etc.

Thanks in advance,
Jim

I believe the integration requires you to have the Sensorpush wifi hub to work. The hub reports your data to the cloud and the integration pulls the data out of the cloud. The integration can’t talk directly to the sensors over bluetooth.

Just installed 2008.08.6 and added

sensorpush:
username: real username
password: real password
sensor:

  • platform: sensorpush

to configuration.yaml

tried to install the Sensorpush integreation, and all I get is No devices found on the network.

nothing is installed

What am I doing wrong?

The brand-new sensorpush integration is bluetooth only, and only works if your HA device is within bluetooth range. I have not yet been able to get it working on my raspberry PI.

This is discussion about the sensorpush integration via HACS that uses the web API if you have the sensorpush wifi gateway.

I’m having the same experience so poked around a bit. It seems that the “samples” api call used by the pysensorpush package needs an additional parameter defined in the body in order to return more than the defaults of temperature and humidity. Implementing this will require a new version of the pysensorpush package. It looks pretty straight forward and I’ve tested the change to the request and verified it does indeed return vpd, pressure and dewpoint as well as temp and humidity.

@ryans are you OK with my adding a “measures” parameter to the samples request body? I’m much more of a downloader than uploader and i don’t want to break this…

Yes, feel free to submit a pull request and I’ll merge it in. You can test it by copying the integration manually over to your HA instance and verify that the pressure sensor actually displays.

Is there a chance of adding support for the Sensor Push HT1 to the HA integration?

1 Like

Hi all, I am running HA in a Docker container on a Synology DS218+ NAS. I am having trouble getting the SensorPush integration to work. I have two HT1 sensors and the WiFi gateway. I do not have a bluetooth adapter on my NAS. Do I still need a bluetooth dongle to get this to work or can I connect to the cloud data?

Steps I have done:

  • HACS is installed
  • SensorPush repository is downloaded/installed in HACS
  • I have confirmed that in the Home Assistant docker folder on the NAS under Custom_Components I now have a SensorPush folder with the corresponding files
  • I have added the code in step 3 of the instructions to my configuration.yaml
  • Upon restarting Home Assistant, I get a notificiation “Starting SensorPush, not everything will be available until it is finished” (I think this confirms I added the correct code to my configuration.yaml?)

If I try to make a dashboard gauge, the sensor entities are not found (the two sensors are called “Bathroom” and “House” respectively in the SensorPush app). Is there anything I am doing wrong?

Added: I also tried installing Home Assistant supervised version in a Virtual Machine on the NAS, hoping that this would work better, but I got stuck at the same point

Nevermind… after weeks of trying all sorts of things and learning a TON of new things in the process, I finally figured it out: I retained @email.com in my configuration.yaml instead of changing it to @gmail.com

The good news is I learnt a TON of new things in the process :slight_smile:

Were you ever able to find a solution for this error? I have integrated my SensorPush and am seeing the same errors. I have a WiFi gateway that handles two of the sensors. The other is bluetooth only currently. Possibly this is related to the error?

2023-05-30 11:57:42.707 ERROR (MainThread) [homeassistant.util.logging] Exception in _update_callback when dispatching ‘sensorpush_updated’: ()

Traceback (most recent call last):

File “/config/custom_components/sensorpush/init.py”, line 154, in _update_callback

sensor_data = sensor_results[self._device_id]

KeyError: ‘375969.8833333030928970’

2023-05-30 11:57:42.729 ERROR (MainThread) [homeassistant.util.logging] Exception in _update_callback when dispatching ‘sensorpush_updated’: ()

Traceback (most recent call last):

File “/config/custom_components/sensorpush/init.py”, line 154, in _update_callback

sensor_data = sensor_results[self._device_id]

KeyError: ‘375969.8833333030928970’

2023-05-30 11:58:42.482 ERROR (MainThread) [homeassistant.util.logging] Exception in _update_callback when dispatching ‘sensorpush_updated’: ()

Traceback (most recent call last):

File “/config/custom_components/sensorpush/init.py”, line 154, in _update_callback

sensor_data = sensor_results[self._device_id]

KeyError: ‘375969.8833333030928970’

2023-05-30 11:58:42.489 ERROR (MainThread) [homeassistant.util.logging] Exception in _update_callback when dispatching ‘sensorpush_updated’: ()

Traceback (most recent call last):

File “/config/custom_components/sensorpush/init.py”, line 154, in _update_callback

sensor_data = sensor_results[self._device_id]

KeyError: ‘375969.8833333030928970’

2023-05-30 11:59:42.490 ERROR (MainThread) [homeassistant.util.logging] Exception in _update_callback when dispatching ‘sensorpush_updated’: ()

Traceback (most recent call last):

File “/config/custom_components/sensorpush/init.py”, line 154, in _update_callback

sensor_data = sensor_results[self._device_id]

KeyError: ‘375969.8833333030928970’

I’ve been seeing an issue for a long time now, I have 10+ sensors and when they go down a bit in battery voltage they seam to send very low numbers at times, around -40c. It happens a few times a day.

Strange thing is I can’t see those values in the SensorPush app. Would it be possible for you to handle this with a simple filter that neglects updates that a too far from the previous value?

This is what it looks like when it happens.

I had this same problem because I picked up a new Sensorpush sensor and wanted to use the native BLE interface. This custom component and the native one clash. When the native one detects the new sensor a la BLE, it tries to call for the init for Sensorpush, which in this case it thinks is this custom_component.

To solve this, I renamed the custom_component/sensorpush folder to sensorpush_cloud. I also changed the references to sensorpush domain in const.py (line 1) to sensorpush_cloud, as well as in the manifest.json file (line 2), and changed the name to “SensorPush Cloud” (line 3). Lastly, I changed the references in the configuration.yaml to “sensorpush_cloud”.

When I restarted it, everything came up side-by-side because now it sees two different integrations: Sensorpush and SensorPush Cloud.