TEMPer usb sensor not recognized, udev rules not getting applied

dear community,

i have a TEMPer sensor plugged into a raspberry pi 3 having hass.io image (with latest update - 0.56.2).
i’m facing a strange behavior of udev rules.

Here is what i did to configure:

I added the " -platform: temper" component in the configuration.yaml, under “sensors” section.
Also i added the rules file in /etc/udev/rules.d/99-tempsensor.rules with this content:

SUBSYSTEMS==“usb”, ACTION==“add”, ATTRS{idVendor}==“0c45”, ATTRS{idProduct}==“7401”, MODE=“666”

I repluged the usb sensor and restarted HA (without restarting entire raspberry) but getting error:

2017-10-12 14:15:55 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform temper Traceback (most recent call last):

File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py”, line 164, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=self.hass.loop) File “/usr/lib/python3.6/asyncio/tasks.py”, line 352, in wait_for return fut.result() File “/usr/lib/python3.6/asyncio/futures.py”, line 244, in result raise self._exception File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 55, in run result = self.fn(*self.args, **self.kwargs) File “/usr/lib/python3.6/site-packages/homeassistant/components/sensor/temper.py”, line 45, in setup_platform temper_devices = get_temper_devices() File “/usr/lib/python3.6/site-packages/homeassistant/components/sensor/temper.py”, line 33, in get_temper_devices return TemperHandler().get_devices() File “/usr/lib/python3.6/site-packages/temperusb/temper.py”, line 420, in init usb.core.find(find_all=True, idVendor=vid, idProduct=pid)] File “/usr/lib/python3.6/site-packages/temperusb/temper.py”, line 419, in self._devices += [TemperDevice(device) for device in \ File “/usr/lib/python3.6/site-packages/temperusb/temper.py”, line 95, in init self.lookup_sensor_count() File “/usr/lib/python3.6/site-packages/temperusb/temper.py”, line 164, in lookup_sensor_count if (self._device.product == ‘TEMPer1F_V1.3’) or
AttributeError: ‘Device’ object has no attribute ‘product’

I tried also to restart the entire hassio box (not just the home assistant) - and the rules file get’s deleted :slight_smile:slight_smile:

The device is recognized as input device:

core-ssh:~/tools/ga# hassio host hardware
{
“serial”: [
“/dev/ttyACM0”
],
“input”: [
“RDing TEMPerV1.4”
],
“disk”: ,
“gpio”: [
“gpiochip100”,
“gpiochip0”
],
“audio”: {
“0”: {
“name”: “bcm2835 - bcm2835 ALSA”,
“type”: “ALSA”,
“devices”: {
“0”: “digital audio playback”,
“1”: “digital audio playback”
}
}
}
}

But nothing in /dev/ :

core-ssh:~/tools/ga# ls -la /dev/tty*
crw-rw-rw- 1 root root 5, 0 Oct 27 21:50 /dev/tty

dmesg when i unplug & plug the sensor:

[327020.855110] usb 1-1.3: USB disconnect, device number 7
[327022.934139] usb 1-1.3: new low-speed USB device number 8 using dwc_otg
[327023.053163] usb 1-1.3: New USB device found, idVendor=0c45, idProduct=7401
[327023.053186] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[327023.053198] usb 1-1.3: Product: TEMPerV1.4
[327023.053210] usb 1-1.3: Manufacturer: RDing
[327023.063732] input: RDing TEMPerV1.4 as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:0C45:7401.0007/input/input3
[327023.117477] hid-generic 0003:0C45:7401.0007: input,hidraw0: USB HID v1.10 Keyboard [RDing TEMPerV1.4] on usb-3f980000.usb-1.3/input0
[327023.129115] hid-generic 0003:0C45:7401.0008: hiddev0,hidraw1: USB HID v1.10 Device [RDing TEMPerV1.4] on usb-3f980000.usb-1.3/input1

i already added a comment to a similar issue in github, but i thought to ask also here, maybe somebody aware of a workaround or familiar with this behavior of deleting the udev rules…

many thanks,
alex

1 Like

Any progress @alexciurea? I am experiencing the same problem… Thanks

sorry foxys… unfortunately nothing new, so i’m stuck.

I’m having the same issue 3 years later, any solution?

This doesn’t seem to be caused by home assistant, if I get a shell on the docker container and run temper-poll I get the same error, it must be an issue with how the usb device is being handled by the container.
The strangest part is the temperature sensor is listed in lsusb in docker, I really have no idea where to go from here. I was getting the issue with hassio so I switched back to the standalone docker home assistant (which had temperusb working fine) and no I’m getting the same error there too!

The host machine (rpi3) can run temperusb just fine

Ok I dug deeper and found the source of the issue:
temperusb requires the stable version of pyusb instead of the one being shipped with home assistant. I was able to do a temporary fix by:

  • getting a shell on the home assistant container
  • pip uninstall pysb
  • pip install pyusb

This installed the stable version of pyusb and got everything working, but it’ll have to be done everytime I deploy a new container

Hi all, sorry to revive this old topic, but, did someone manage to have this sensor working with Home Assistant Operating System installation on a Raspberry?

I added this in my config

sensor:
  - platform: temper
    name: Test

and this line to /etc/udev/rules.d/99-tempsensor.rules :

SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="e025", MODE="666"

but no new sensor appears and I don’t see anything related to temper in the log… what am I missing here?

I couldn’t get it to work like that either, in HASSOS. However I did pull together a configuration that works for me.