homeassistant-fullykiosk icon indicating copy to clipboard operation
homeassistant-fullykiosk copied to clipboard

Submit to HA Core

Open cgarwood opened this issue 2 years ago • 30 comments

I'm in the process of submitting this component to HA Core for inclusion in 2022.9. There are a few breaking changes between this custom component and the version that will be in HA Core:

Changes:

  • WiFi level sensor has been removed
  • Last App Start time sensor has been removed
  • The light entity for controlling the screen has been removed and replaced with a switch for turning the screen on and off, and a number entity for controlling brightness, to better line up with HA architecture.
  • The integration domain has been changed from fullykiosk to fully_kiosk - you'll need to re-setup the integration or do some find & replace magic on HA's config files to migrate.

New Features:

  • DHCP discovery - if your tablet IP changes the config entry will be automatically updated to point to the new IP (based on mac address)
  • Media player supports stopping media
  • HA diagnostics support

Still a few more PRs to submit, but I'll try to keep this updated with changes until the HA release.

cgarwood avatar Aug 18 '22 11:08 cgarwood

HA 2022.9 beta is out with the new integration in core - however I didn't get a chance to PR the services to open a URL, open an app, or set a configuration parameter so those 3 services will be missing in the core component for 2022.9

cgarwood avatar Aug 31 '22 19:08 cgarwood

Great news! Do you still need some beta testing or it is ready for final release?

adorobis avatar Sep 07 '22 09:09 adorobis

Nice job Charles !!! 🥰

@cgarwood , did you planned to push services in HA core ?

chpego avatar Sep 07 '22 16:09 chpego

Very nice, a lot of new integrations are pending for months, but this integration did the job within one. Beta tested without problems. Big thank you

KNXBroker avatar Sep 07 '22 18:09 KNXBroker

@chpego planning to copy over the services for open url, open app, and set config parameter. Just ran out of time before the beta & release. I believe the rest of the services have been replaced by button entities or stock media_player services.

cgarwood avatar Sep 07 '22 21:09 cgarwood

Thanks for moving this to core! Awesome job. Just 'migrated' and after some device/entity id renames everything seems to be working fine.

DavidDeSloovere avatar Sep 08 '22 04:09 DavidDeSloovere

Hi @cgarwood , is the Service: fullykiosk.start_application already available? I'm using this service to open a native android app. If not, can I still use the HACS version then instead or should I stay in an older HASS version? Thx!

h4nnes avatar Sep 08 '22 13:09 h4nnes

I'm on the same situation :)

felipecrs avatar Sep 08 '22 13:09 felipecrs

But I updated HA to 2022.9, and the HACS version of Fully Kiosk is still working.

felipecrs avatar Sep 08 '22 14:09 felipecrs

I would remove the HACS version though. Might get confusing after a while.

DavidDeSloovere avatar Sep 08 '22 15:09 DavidDeSloovere

Of course, I'll do it as soon as the core version receives the start_application service.

felipecrs avatar Sep 08 '22 16:09 felipecrs

It doesn't look like the services made it into the HA 9.0 release. When are you thinking those will make it? I used to use the fullykiosk.load_url to bring up doorbell camera feed when a person was detected.

mclever avatar Sep 09 '22 01:09 mclever

~~Any chance you could also bring over the fullykiosk.play_audio service? I used this to play a custom beep sound on my wall mounted tablets when a door or window was open. I can't seem to find a way to replicate this using the HA media player services.~~

Nevermind, completely missed the Media Player: Play media service, lol.

shred86 avatar Sep 10 '22 20:09 shred86

Any chance the you can bring over the fully_kiosk.say command? I very much prefer the sound of the FK voice for announcements as opposed the Google TTS. Thank you!

ayw93 avatar Sep 11 '22 22:09 ayw93

What is the right/easiest way to switch from the HACS version to the new HA core version?

PexJensen avatar Sep 13 '22 14:09 PexJensen

Delete the integration from HACS and add official one on the integration page. You might want to check any automations for device/entity ids that might change. (off topic, check watchman)

DavidDeSloovere avatar Sep 13 '22 15:09 DavidDeSloovere

So I have switched from HACS to the official integration. Was really smooth as everything I was using is there. Great! For those who like the screen to be represented as light entity there is a way by configuring a template light. Below is my code (in light.yaml file). Works pretty well, only the number entity for screen brightness is behaving a bit strange:

- platform: template
  lights:
    lenovo_tab_m10_screen:
      friendly_name: "Lenovo Tab M10 Screen"
      level_template: "{{ states('number.lenovo_tab_m10_screen_brightness') | int}}"
      value_template: "{{ is_state('switch.lenovo_tab_m10_screen', 'on') }}"
      turn_on:
        service: switch.turn_on
        data:
          entity_id: switch.lenovo_tab_m10_screen
      turn_off:
        service: switch.turn_off
        data:
          entity_id: switch.lenovo_tab_m10_screen
      set_level:
        service: number.set_value
        data:
          value: "{{ brightness }}"
          entity_id: number.lenovo_tab_m10_screen_brightness

adorobis avatar Sep 16 '22 17:09 adorobis

Hi guys! I use fully kiosk on 4 of my tablets and this addon is perfect for controlling them (thanks!!). I have one question, though: i have two identical tablets (Lenovo M10) , so all fully-addon sensors are named, say "switch.lenovo_tab_m10_screen" and "switch.lenovo_tab_m10_screen_2". Is there any way to rename one of them? So that i won't end up with those annoying "_2" at the end. I searched, and didn't find it. I can rename device as such, but sensors doesn't change their's names.

Protoncek avatar Nov 15 '22 09:11 Protoncek

Migration experience:

I've gone the "add the core integration, keep the custom one for a while and compare everything entity by entity" route as proposed here https://community.home-assistant.io/t/2022-9-home-assistant-birthday-release/458283/82.

  • By renaming the custom integration entities (IDs) to "*_old" and using the former entity_id for the new one, I didn't need to change much in the UI and automations except the remove two entites for wifi strength and last app start.
  • After that, deleting the custom integration and uninstalling it afterwards from HACS, rebooting HA once - done.
  • Took me roughly 1,5 hours for one device, in the end a pretty smooth migration.
  • And finally the media player entity has a usable state (custom integration: always "unknown") - but for that, see issue below.

1. BUT the following things are kind of a problem and partly a step back compared to the custom integration:

1.1 Incomplete light entity

  • The light entity for controlling the screen has been removed and replaced with a switch for turning the screen on and off, and a number entity for controlling brightness, to better line up with HA architecture.

That's quite a downgrade ⬇ in my opinion. Lights with the ability to set the brightness should have that config option directly in the entity.

  • First thing I did is create a light entity again out of the switch entity (Using "SwitchAsX").
  • Now I got a light entity without the ability to easily control the brightness...
  • Long story short: please explain that decision of splitting the light entity or (preferred solution) please reimplement this for the core integration.

1.2 Media_Player behavior Once the media player entity switches to playing, it keeps that state like forever. That's a problem as it is used massively for notifications (so no one is clicking "stop" regularly) and therefore renders the state useless (again). Custom integration: unknown. Core integration: playing. ➡ Filed an issue for this at https://github.com/home-assistant/core/issues/83261

1.3 No services available As mentioned I ran custom and core integrations together, removed the custom one later and restarted HA. Since that restart, there's absolutely NO ⚠ FullyKiosk service available anymore: grafik ...even there should be at least those two currently according to https://www.home-assistant.io/integrations/fully_kiosk#services

Did they maybe get removed together with uninstalling the custom integration? ➡ Filed an issue for this at https://github.com/home-assistant/core/issues/83260 ➡ Update: My fault, I'm still on HA Core 2022.9.7 and according to https://github.com/cgarwood/homeassistant-fullykiosk/issues/118#issuecomment-1336537122 FullyKiosk services have been added one Core release later in 2022.10 so I simply need (and will do so shortly) update HA Core. Mentioned issue has been closed.

✔ **1.4 Missing service fullykiosk.volume_set That service is the only option to silence my devices during night. Now HA already trew a problem because of this: grafik ...and the WAF went down massively -.- So this now bothers me constantly, every day :-( I shouldn't have removed the custom integration that early. ➡ Can you please migrate that service from the custom to the core integration @cgarwood ? How can I help you on doing this? ➡ Update: thanks to https://github.com/cgarwood/homeassistant-fullykiosk/issues/118#issuecomment-1336534571 simply using service media_player.volume_set does the same thing. Maybe the docs should highlight this clearly, so there's not even a need for that former service basically doing the same.


Any need for bug reports / feature requests as single issues for those listed points @cgarwood ?


2. Further suggestions for minor improvements:

2.1 Make values show up visually instead of numbers only

Currently needed in customize.yaml:

sensor.*_screen_orientation:
  state_class: total
  unit_of_measurement: ""

2.2 Kiosk Mode Switch (Unrelated to the migration itself) What about making the "binary_sensor.*_kiosk_mode" entity a switch entity? Currently there seems to be no possibility to enable/disable the kiosk mode remotely. Maybe using the service: fullykiosk.set_config? An UI item (switch entity) would be a first class solution.

bcutter avatar Dec 04 '22 19:12 bcutter

1.2 Media_Player behavior

Indeed, same experience here. Stays in "playing" state after finished playing TTS announcement. For me this is anyway improvement as the custom integration was showing media player in unknown status all the time.

1.3 No services available

I can see those two services there: image

1.1 Incomplete light entity

I think it was explained that screen cannot be light due to HA standards and it was feedback from the HA core team. You can create a template light which will have all needed controls if that is important. Here an example:

- platform: template
  lights:
    lenovo_tab_m10_screen:
      friendly_name: "Lenovo Tab M10 Screen"
      level_template: "{{ states('number.lenovo_tab_m10_screen_brightness') | int(0)}}"
      value_template: "{{ is_state('switch.lenovo_tab_m10_screen', 'on') }}"
      availability_template: "{{ not is_state('number.lenovo_tab_m10_screen_brightness', 'unavailable') }}"
      turn_on:
        service: switch.turn_on
        data:
          entity_id: switch.lenovo_tab_m10_screen
      turn_off:
        service: switch.turn_off
        data:
          entity_id: switch.lenovo_tab_m10_screen
      set_level:
        service: number.set_value
        data:
          value: "{{ brightness }}"
          entity_id: number.lenovo_tab_m10_screen_brightness

adorobis avatar Dec 04 '22 22:12 adorobis

2.2 Kiosk Mode Switch

This is not available in the REST API of kiosk app so I don't think it is at all possible. As far as I was checking the integration has implemented all available features of the API. You can check here: https://www.fully-kiosk.com/en/#rest

adorobis avatar Dec 04 '22 22:12 adorobis

2.2 Kiosk Mode Switch

This is not available in the REST API of kiosk app so I don't think it is at all possible. As far as I was checking the integration has implemented all available features of the API. You can check here: https://www.fully-kiosk.com/en/#rest

Well it's the first entry so... should be possible.

grafik

Or does this mean the Kiosk lock (which is indeed implemented)? A bit of a wording/function confusion here.

  • I have: switch.*_kiosk_lock and binary_sensor.*_kiosk_mode
  • I want: switch.*_kiosk_mode

I can see those two services there:

I have none. Restarted HA again multiple times - nothing. I need urgently:

  • fullykiosk.volume_set ...as this is used to silence the tablets during the night. HA already complained (brought up my first repair entry): grafik

Damn, I think I removed that custom integration a bit too quickly. --> Update: thanks to https://github.com/cgarwood/homeassistant-fullykiosk/issues/118#issuecomment-1336534571 simply using service media_player.volume_set does the same thing. Maybe the docs should highlight this clearly, so there's not even a need for that former service basically doing the same.

bcutter avatar Dec 04 '22 22:12 bcutter

Or does this mean the Kiosk lock (which is indeed implemented)? A bit of a wording/function confusion here.

Yes, I believe this is the one. But those are two different things. As far as I know kiosk lock will require password to unlock but kiosk mode will still be on. It seems that you can disable kiosk mode only from the app on the device.

Regarding services: are you running latest version of HA? Maybe it was implemented later.

For volume: there is no such service dedicated to fully kiosk, probably you can use media_player.volume_set instead.

adorobis avatar Dec 04 '22 22:12 adorobis

Or does this mean the Kiosk lock (which is indeed implemented)? A bit of a wording/function confusion here.

Yes, I believe this is the one. But those are two different things. As far as I know kiosk lock will require password to unlock but kiosk mode will still be on. It seems that you can disable kiosk mode only from the app on the device.

Regarding services: are you running latest version of HA? Maybe it was implemented later.

I filed an issue for the missing services at https://github.com/home-assistant/core/issues/83260. I'm on HA Core 2022.9.7 now.

Also filed an issue for the media player always in playing state at https://github.com/home-assistant/core/issues/83261.

For volume: there is no such service dedicated to fully kiosk, probably you can use media_player.volume_set instead.

Works perfect! Thank you so much. 👍👍👍

bcutter avatar Dec 04 '22 22:12 bcutter

I'm on HA Core 2022.9.7 now.

So you need to upgrade. According to this one it has been added in 2022.10 release.

adorobis avatar Dec 04 '22 22:12 adorobis

I can rename device as such, but sensors doesn't change their's names.

@Protoncek you can just rename each entity_id as well

adorobis avatar Dec 04 '22 22:12 adorobis

I'm on HA Core 2022.9.7 now.

So you need to upgrade. According to this one it has been added in 2022.10 release.

Oh man... should have read the initial post three times, not only twice. Thanks!

bcutter avatar Dec 04 '22 22:12 bcutter

@adorobis yes, that’s “kinda” solution. But way easier would be to rename in one “go”.

Protoncek avatar Dec 05 '22 16:12 Protoncek

Well, actually you can rename all entities of a device in one go. When you change the device name it will ask if all entities should be renamed as well. Works great: image image

adorobis avatar Dec 05 '22 16:12 adorobis

Ahhh… I renamed in wrong place, so HA didn’t ask me that… on basic devices page i selected my device, clicked three dots and rename… your option works, of course. Thanks!

Protoncek avatar Dec 05 '22 19:12 Protoncek