[APP][Pro] Home Assistant - Community App

I allready had an onoff_state capability for the HA entity binary_sensor.aarlo_connected_trapp. This used to turn the tile active/inactive based on if the camera was connected to the network or not. This stopped working when I readded the camera to Homey with supported features = 3. The On/off switch capability was not the same as my onoff_state capability. That’s why I wanted to get rid of the On/off switch. :blush:
When converting the on/off switch to an onoff_state capability I will end up with two onoff_state capabilities pointing to two different entities in HA.

I did some more testing.
Subcapability for onoff_state works fine, but when a main capability coexits only maincapability turns the tile state. I still believe this fix may be relevant for all users that do not want to accidentally turn off the camera. Some camera models need a press on a button on the physial device to turn it on.

Thanks a lot! :star_struck:

1 Like

New test version 1.5.15:

  • Fixed ‘The alarm or switch turned on’ trigger for onoff/onoff_button capabilities.

@JOR1 Can you please test the trigger again? It seems I forgor the onoff* capabilities for this trigger beside the alarm capabilities during restructuring the code.
The ‘capability has changed’ was still working and returned the true/false tag, but not the special on/off trigger.

This trigger now works as intended.
I changed my flow trigger to use this one since the “Value of capability xxxx changed” still has strange behaviour. I think this issue may be on the HA side. I have HA automations that triggers when the state of input_booleans change. The automation in HA actually triggers when button is pressed in Homey, even if I can not see any change of state for the input_booleans.
A very strange issue.

The Homey trigger [Value of capability xxxx changed] is only started if the entity changes really changes (old value != new value). So this should trigger only in Homey if a new state is pushed from HA.

Do you have an exapmle for this?

The automation in HA actually triggers when button is pressed in Homey, even if I can not see any change of state for the input_booleans.

When you press a switch (not button, onoff_button in technically a switch (onoff) shown on the button page :wink:), the general HA service call is sent to HA:

  • domain: homeassistant
  • service: turn_on / turn_off
  • entity_id: your entity assigned to the onoff_button capability

But a switch press should change the state in Homey - and after the service call also in HA. Else the states from Homey capability and HA entity must be out of sync (Homey is switching on, but HA is still on).

I sent you a PM e few days ago since I had allready posted here 3 times in a row and was not able to reply or make another post. Did you receive the mail with my setup with “Value of capablity xxxx changed” and screnshots from Homey and HA? Please let me know if I schould post it here?

Hi, yes, got it. And based on you example I found the issue for the switch on/off trigger corrected in newest test version.
For capability changed trigger I could’t find an issue.

If you could describe the previous state, what switch you changed and what happened, I can try to reproduce.

Thanks a lot for digging in to this. :slightly_smiling_face:
I’m really busy for the next hours, but I will provide you with more details this afternoon.

App keep crashing this morning, not sure why, comes up with memory limit reached?
I’ve sent a crash report:
44441412-8800-4571-9568-7ac8d2f8f27f

Hi,

  1. I had such an error only once where a user activated a HA integration that seemed to cause a lotif traffic. Not your case I think.

  2. You installes FW 10.3.0? Happened it since this update?
    I can see a lot of errors ‘app crashed’ without ‘countdown’ messages before.

  3. The app crashes immediatly after a restart, right? HA is sending all entities and entity updates on startup. And devices get initialized with new data. Don’t know if the HA traffic increased, perhaps also caused by Homey itself if you are syncing other data with MqttHub back to HA.
    Is it possible to restart the app separately?

  4. Can you create a flow with the app trigger for memory/cpu warnings to write to timeline or send push messages? I would like to check if there are warnings before the app crashes. Previously these events didn’t work on HP23. So if the app crashes without this trigger, I have to report a bug again to Athom…

And sorry about this. HP23 is ‘too fast’ so it processed a lot of stuff in short time with high CPU load. On HP19, it was processed slower and CPU load didn’t get such a peak.
But all data is coming from HA via Websocket. So there is not so much I can do if the traffic increases for a short time.

Thanks @RonnyW - been playing with this and seeing if I can reduce. Yes seemed to start after 10.3.0.
Restarting the App after the crash didn’t help and as you say, it was crashing within a minute or so after start-up. I checked on any MQTT and did a reset there just in case then rebooted Homey and the HA and will monitor, seems to have settled for now but will keep and eye on it.

How did it start to crash? Homey update? Or perhaps an HA update/restart?
I’ve seen a lot of traffic if HA is starting and all entities gets updated.

I’ve not been able to reproduce.

Hi. I was able to reproduce the capability changed issue again.
Here’s my setup:
Homey App:


Onoff buttons pointing to corresponding input_booleans in HA.

I have set up HA automation for the 3 input Booleans like this:

If one of the buttons are set to On, the automation for that button triggers. Automation will set the alarm as to Activate Away, Deactivate or Activate Home and switch the two other buttons off. This ensures only one button is turned on at the time.

This works fine without issues.

Then I add flows to Homey:


This flow with only to cards to evaluate with All card works fine.

Then I add another evaluation to the All card and also setting Boolean variable:


Now I have the issue.
The input_booleans in HA does not change and after a while I get this error in the Homey Phone app:

Maby something takes too long to finish up at the Homey side and message to HA is never sent?

The flows always seem to trigger 2 times in a row within a second. I wonder why?

You click the button in your Homey device.
This starts sending the service call to HA.
But beforre the message is sent to HA, the app triggers the “capability changed” trigger.
And this trigger is processed synchronous (awaiting the result).

But your flow never finishes becasue the ALL condition never gets true. Perhaps that’s why the app is waiting until the timeout and the new state is not sent to HA.

I will change the trigger to be async (not waiting).
I think this will solve the timeout.

New test version 1.5.16:

  • Fixed ‘capability changed trigger’ for onoff/onoff_button capabilities.

@JOR1 fyi

1 Like

Thanks a lot, Ronny!

This fixed the issue. :heart_eyes:

1 Like

What is wrong here?

image

I get the same error in HA developer tools. Please check the correct syntax in HA and then use this in Homey flow card.

Aaarh I found the fault; I should call service “media_player.play_media” instead of “media_player.media_play”.
The names are too similar! :smiley:

Anyway, thanks for fast response!

1 Like