Version 1.0.0 - Entity ID to Device ID
If you're having issues with your automations and getting errors like Error: 'NoneType' object is not iterable - have you checked the breaking changes?! Service calls need to call the DEVICE, not the Entity.
You can easily update from entity to device in the automation GUI - but this may invalidate your YAML if the automation is complex. Updating from entity to device in YAML is trickier. You need to change the following:
target:
entity_id:
- open_epaper_link.00000123ABC456DE
to:
target:
device_id:.THIS_IS_YOUR_DEVICE_ID
Easiest way I have found to find your device_id is to click on the tag device in the integration e.g. https://YOUY_HA_URL/config/devices/dashboard?domain=open_epaper_link , and click on the tag. This will give you the device ID in the URL to copy, e.g. - https://YOUY_HA_URL/config/devices/device/THIS_IS_YOUR_DEVICE_ID
Is there a better/easier way to get the device ID to copy into YAML automations??
Of course this method only works in a browser. If you’re accessing HA via the app (on an iPad, say) then the URL isn’t shown so you’ve no idea of the device_id.
If that’s you, just open HA in a Safari window temporarily.
Shame we have to do this…
Of course this method only works in a browser. If you’re accessing HA via the app (on an iPad, say) then the URL isn’t shown so you’ve no idea of the device_id.
If that’s you, just open HA in a Safari window temporarily.
Shame we have to do this…
Yeah, noticed that too if you have the Windows 'app' installed - it's a browser window that's in kiosk mode, so no URL either.
You can also use Developer tools > Actions > OpenEPaperLink: Draw Custom Image.
Choose you tag and switch to YAML mode.
I'm finding this suggested way of specifying the device_id is not working for me :-?
Script is unavailable Actions: expected a dictionary for dictionary value @ data[0]['target']
Looking at the script in the UI in YAML mode, it's merged the target/device_id line after importing the script. ie in the script I have:
target:
device_id:.<MAC>
But this turns into the following after reloading scripts:
target: device_id:.<MAC>
I'm finding this suggested way of specifying the device_id is not working for me :-?
Script is unavailable Actions: expected a dictionary for dictionary value @ data[0]['target']
Looking at the script in the UI in YAML mode, it's merged the target/device_id line after importing the script. ie in the script I have:
target: device_id:.<MAC>But this turns into the following after reloading scripts:
target: device_id:.<MAC>
It's not the MAC, it's the device ID that Home Assistant assigns to the tag.
I really don't like the change. Optional (so that both ways are supported) o.k., but mandatory? I'm not using devices anywhere. Because it is so hard to replace them. There are a lot discussions around it. If I want to replace a device with another, I just have to set the entitiy_id to the one before and be done everywhere. In UI, in automations, in scripts, ... With device_id, I have to rework everything.
This is really not a good idea to force this here in this single integration. I don't have any other integration or service-call in use, where only device_id is allowed.
I really don't like the change.
Agreed. I did eventually make it work in Node-RED using the lookup method suggested by @jurasjo upthread. But still a royal pain..
This is really not a good idea to force this here in this single integration. I don't have any other integration or service-call in use, where only device_id is allowed.
This, and the fact that my devices are now littered with unavailable entities, has me reverting this integration. Sigh.
Hey, thanks for posting this. I spent way too long trying to debug this. I'm a little irritated that you can't easily lookup the device_id. I shouldn't have to use the Developer Tools GUI to find the id. This change will also be more difficult for me to troubleshoot. I have one automation that sends the same weather information to 3 different tags. If I have an issue with a tag I have to go lookup the device_id and figure out which Tag MAC it matches. It was nice to just scan the barcode on the tag to identify the entity_id.
Yeah, i agree. I'd like to see the ability to target the entity again, or ability to know the device better??
I did discover an easy way to find the device_id. To get the Device ID:
Goto settings -> Devices then click on the device. Click on the device Click on the plus button in Automations. Click on "Use device as trigger". This will open the automation editor page. Click three dots, choose “Edit in YAML” - you will see device_id and entity_id of this device. Don't save the automation, just exit the editor.
@g4bri3lDev You did these changes from using entity_id to device_id, didn't you? Can you jump in and explain, why it was necessary or why did you do it. At least with supporting the entity_id as well in the service calls as well and as it is usual in nearly every other service call I know?
Can you please make the device_id-way only optional and bring back the entity_id way?
@g4bri3lDev You did these changes from using entity_id to device_id, didn't you? Can you jump in and explain, why it was necessary or why did you do it. At least with supporting the entity_id as well in the service calls as well and as it is usual in nearly every other service call I know?
Can you please make the device_id-way only optional and bring back the entity_id way?
This isn't my repo, I only raised this issue to highlight how to change people's YAML in automations. I'd recommend raising a new issue requesting having device or entity options, or finding a new/better way to target tags in the automations?
@g4bri3lDev You did these changes from using entity_id to device_id, didn't you? Can you jump in and explain, why it was necessary or why did you do it. At least with supporting the entity_id as well in the service calls as well and as it is usual in nearly every other service call I know? Can you please make the device_id-way only optional and bring back the entity_id way?
This isn't my repo, I only raised this issue to highlight how to change people's YAML in automations. I'd recommend raising a new issue requesting having device or entity options, or finding a new/better way to target tags in the automations?
Sorry!! Just noticed you were tagging the author, not me!!!! It's too early for me here! Haha
I did discover an easy way to find the device_id. To get the Device ID:
Goto settings -> Devices then click on the device. Click on the device Click on the plus button in Automations. Click on "Use device as trigger". This will open the automation editor page. Click three dots, choose “Edit in YAML” - you will see device_id and entity_id of this device. Don't save the automation, just exit the editor.
I found a simpler way: you can locate the device id from the url of the device page