Core: Mobile App never updates sensors after initial setup

Created on 19 May 2020  Â·  24Comments  Â·  Source: home-assistant/core

The problem

Mobile app integration (iPhone) never updates sensors after initial setup. for instance, sensor.battery_level, sensor.battery_state, and sensor.last_update_trigger never change.

Environment

  • Home Assistant Core release with the issue: 0.109.4
  • Last working Home Assistant Core release (if known):
  • Operating environment (Home Assistant/Supervised/Docker/venv): Docker
  • Integration causing this issue: Mobile app
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/mobile_app/

Problem-relevant configuration.yaml

none

## Traceback/Error logs
<!--
  If you come across any trace or error logs, please provide them.
-->

```txt

Additional information

mobile_app

Most helpful comment

This is a long standing known issue with no movement. The code fix has been in place for months but no release attempts have been made. https://github.com/home-assistant/iOS/issues/547

All 24 comments

Hey there @robbiet480, mind taking a look at this issue as its been labeled with a integration (mobile_app) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

This is a long standing known issue with no movement. The code fix has been in place for months but no release attempts have been made. https://github.com/home-assistant/iOS/issues/547

This needs to be fixed asap. I understand iOS developer doesn't have time anymore. I can pay for apple developer fee and manage publishing process. My swift knowledge is not enough but in time I can also help development of it

Suggestion, perhaps dev of the Android and iOS companion apps should be moved in house to Nabu Casa?

I see IOS 13.4 mentioned. IOS 12.4.1 on my iPhone 8. This is a general problem not related to IOS 13.4 only.

@SamuelCarson

do you see these errors in Logs?

Received invalid webhook payload: required key not provided @ data[12]['state']. Got None
Received invalid webhook payload: required key not provided @ data[11]['state']. Got None

Only webhook entries are:

2020-05-20 01:59:36 DEBUG (MainThread) [hacs.repository.integration.jihao.rokid-webhook-hass] Getting repository information
2020-05-20 01:59:36 DEBUG (MainThread) [hacs.repository.integration.jihao.rokid-webhook-hass] Running checks against 0.1.3

From: mbaran5
Sent: Tuesday, May 19, 2020 6:24 PM
To: home-assistant/core
Cc: SamuelCarson ; Mention
Subject: Re: [home-assistant/core] Mobile App never updates sensors after initial setup (#35812)

@SamuelCarson

do you see these errors in Logs?

Received invalid webhook payload: required key not provided @ data[12]['state']. Got None
Received invalid webhook payload: required key not provided @ data[11]['state']. Got None
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

This is not a fix but more of a bandage until the app is fixed, but if anyone wants to try it it seems to be working..

https://github.com/brg468/core/tree/mobile_app_webhook_fix

https://github.com/brg468/core/tree/mobile_app_webhook_fix/homeassistant/components/mobile_app

@brg468 That appears to have worked, though it does still throw some errors

Logger: custom_components.mobile_app.webhook
Source: custom_components/mobile_app/webhook.py:189
Integration: Mobile App (documentation)
First occurred: 2:44:50 PM (18 occurrences)
Last logged: 2:44:50 PM

Received invalid webhook payload: required key not provided @ data['state']. Got None
Refusing to re-register existing sensor connectivity_sim_1!
Refusing to re-register existing sensor last_update_trigger!
Refusing to re-register existing sensor geocoded_location!
Received invalid webhook payload: required key not provided @ data[12]['state']. Got None

Could be wrong but I think you need all the files not just those 2 in custom_components/mobile_app for it to work.

Yeah, sorry, I sneaky deleted the post and reposted it. I copied the whole folder. Appears to be working with exceptions of a few errors thrown.

@mbaran5 the re-register error should stop, the invalid webhook one will persist, I didn’t bother taking that out since hopefully this is temporary.

@mbaran5 If your interested I just updated webhook.pyto take out the errors in the logs for now. Its pushed to the branch above.

Hey @brg468 this seem's like a good server-side fix to the problem. I agree the app will need updating to fix the root problem but more robust error handling is a great addition. Would you be able to submit a PR for this once you're at a point you're happy with it? It may even be able to get into a patch release 🤞

@balloob what are your thoughts on this?

It would fix the sensor issue while we wait for an app update which has been pending for a while it sounds like.

Robbie has booked some time week after next to fix the iOS app bugs. However, I still think a PR for your patch is good to make the code more robust

@TomBrien Well I tried but it was shot down, as I kinda expected. Ill keep my branch up for anybody that wants to go the custom_components route.

I’m not sure it is shot down. Robbie is code owner and approved the change.

I know, but I’m under the impression Martin won’t merge it if he doesn’t like it.

This is not a fix but more of a bandage until the app is fixed, but if anyone wants to try it it seems to be working..

https://github.com/brg468/core/tree/mobile_app_webhook_fix

https://github.com/brg468/core/tree/mobile_app_webhook_fix/homeassistant/components/mobile_app

Is it possible to replace the old files with these ones?
I am running HassOS on Raspberry Pi 4
I tried to find components folder using Putty but I have luck finding it
I am totally new in Home Assistant and I don't have a lot of experience

You should be able to add the entire mobile_app folder to config/custom_components if you're able to locate that. Sorry I'm not much help with HassOS.

You should be able to add the entire mobile_app folder to config/custom_components if you're able to locate that. Sorry I'm not much help with HassOS.

Solved thank you

FYI a PR to fix this was just submitted by Paulus. It’s home-assistant/core#36433

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sibbl picture sibbl  Â·  3Comments

arangates picture arangates  Â·  3Comments

moskovskiy82 picture moskovskiy82  Â·  3Comments

Elmardus picture Elmardus  Â·  3Comments

neonandu picture neonandu  Â·  3Comments