Invalid config fixed with 0.0.6-alpha build.
Do you want to open this as an issue and tag it as āinvestigateā?
Not at the moment. Maybe later.
Iām currently having difficulty testing UPB events.
- Iām using 0.0.6-alpha
- I added
upb.scene_activated
to Developer tools > Events > Listen to events - Clicked Start listening
- Pressed a button that activates link 2.
- I see no response in the UI
I changed it to upb.scene_activate
but got the same result.
What is your recommended test procedure for evaluating events? Also, where in the source code does it generate events?
EDIT
FWIW, this automation wasnāt triggered when I pressed a button that activates link 2:
- alias: 'UPB event'
trigger:
- platform: event
event_type: upb.scene_activated
action:
- service: persistent_notification.create
data_template:
message: 'entity_id: {{trigger.event.data.entity_id}}'
title: 'UPB Scene Activated'
What am I missing here?
Here is what is working for me:
- id: scene-activated
alias: "Scene activated"
trigger:
platform: event
event_type: upb.scene_activated
event_data:
entity_id: scene.family_room_half
action:
service: system_log.write
data_template:
message: "Activated '{{trigger.event.data.entity_id}}' Data '{{trigger}}'"
And the log that is generated on a button push:
2020-02-02 22:51:50 ERROR (MainThread) [homeassistant.components.system_log.external]
Activated 'scene.family_room_half' Data
'{'platform': 'event', 'event': <Event upb.scene_activated[L]: entity_id=scene.family_room_half>}'
Iām sure I donāt need the event_data
on the trigger, but no time to try right now.
The code is in scene.py
. Look for fire
.
New version 0.0.7-alpha release up. Moving fast, so surely some bugs, but heading in a good direction. THANK YOU for all the testing everyone is doing!
@gwww I got everything switched over and I found that bug. Thanks for the wicked-fast turn around. Good timing for all this being the wife wasnāt home tonight.
Weāre live!
In the light.turn_on
service, how is the value of transition
mapped to UPBās fade_rate values?
UPB fade_rate values
0 = Snap
1 = 0.8 sec
2 = 1.6 sec
3 = 3.3 sec
4 = 5.0 sec
5 = 6.6 sec
6 = 10 sec
7 = 20 sec
8 = 30 sec
9 = 1 min
10 = 2 min
11 = 5 min
12 = 10 min
13 = 15 min
14 = 30 min
15 = 1 hr
UPB supports the sixteen discrete time-periods (shown above) whereas Home Assistantās transition
option is expressed in seconds.
If I set a lightās transition
to 45
(seconds) how is that converted to one of UPBās sixteen fade_rate values? Is 45
rounded up to the closest matching fade_rate
level? In other words, for this example, it would be 9
?
I have a pretty basic setup with 10 devices. So far itās working pretty great. I have not tried scene entities yet. Iāll try to do that tomorrow.
How does one go about acquiring the following information from a device?
- If the device is programmed to report its state when operated manually.
- The deviceās default fade-rate.
The Get Register Values command can request a Register Values Report from a device but I donāt know which registers store the default fade-rate and status reporting.
The documentation (from PCS) simply says this:
If I understand it correctly, the first 64 bytes of the Setup Register are collectively known as the UPBID and are consistent for all brands of UPB devices. The remaining bytes are called Configuration Registers and their contents depend on the manufacturer. So is it possible that the two properties Iām requesting are not located in the same Configuration Registers for PCS, Web Mountain, and Simply Automated?
Latest build is up 0.0.11-alpha.
All open issues have been have been coded and uploaded! Yipee!!
Time to open some more Add enhancements of what you would like done next.
I will be out of country, and hence not coding or responding to emails from Feb 14-24. Maybe get lots of testing done then!
Before you leave, can you explain how transition
is being handled? Or direct me to where itās being done in the code?
If I set transition
to 45
(seconds) how is that converted to UPB fade-rate? Rate #8 is 30 seconds and rate #9 is 1 minute. Is the transition
value rounded up to the nearest fade-rate?
Not leaving for another week
The value entered for a transition is passed on directly to the end device. So if you enter a 6 youāll get 10 seconds (the table you posted is the translation Iām using in my description here). So, you canāt enter 45 seconds as a transition value. You could pick a value of 8 to get a 30 second transition or a value of 9 to get a 1 minute transition.
I can point you to the code but it is super boring. As I say above it just takes the number you give and shoves that out onto the wire.
The reason I pass it on directly is I donāt know how a device will respond to the transition value.
Better ideas most gladly accepted!
Thanks, I didnāt know it uses the supplied value verbatim (i.e. uses it as UPB fade-rate).
I think that may need to change in the future in order to comply with how Home Assistant defines transition
. The value represents time in seconds. Thatās why I had asked if it was being rounded to match the nearest discrete UPB fade-rate.
I use rate
for Scene
s for that reason. Youāre right, need to do something about transition
for lights. I just donāt know what that is.
I could map it to the closest value, at least for the values we know. The problem is what do all the devices do? And, if we did map it for lights then should probably use the same mapping for links.
I suggest mapping it to the nearest discrete fade-rate value.
The documentation for the UPB integration can explain that transition
values are mapped to UPB fade-rates and the maximum duration is 1 hour.
I donāt understand the question. Wonāt the devices simply change their brightness at the specified fade-rate?
Thereās no documentation on the transition rates. If we map them we may not get the desired effect on devices that donāt use the same rates as the devices we know about.
Look in the UPB Command Wizard, at the step where you would specify fade-rate, it lists the fade-rate values and the durations they represent. Thatās where I got the list I posted above.
EDIT
Used transition
when I meant fade-rate
. Duh.
Sorry, 123 Taras. Iām out of town right now and not back until next Monday and just now saw this. On the first question - āIf the device is programmed to report its state when operated manuallyā - Iām assuming you want to know if the device is programmed like that - and you already know how the device responds when the switch is operated manually.
Your assumption at the end is correct. Once you get into the Configuration Registers, all bets are off between manufacturers. Itās possible that there will be some commonality between manufacturers, but itās not guaranteed. And, the SA / WMT devices are very different from the PCS devices. When I get back, I can try to find my register maps and see where that information is located on our dimmers and then try to determine if thatās where the same information is located on the PCS or SA devices. I might be able to find this information for the PCS devices, but doubtful for the SA devices.