Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Submit to HA Core #118

Open
cgarwood opened this issue Aug 18, 2022 · 30 comments
Open

Submit to HA Core #118

cgarwood opened this issue Aug 18, 2022 · 30 comments

Comments

@cgarwood
Copy link
Owner

cgarwood commented Aug 18, 2022

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
Copy link
Owner Author

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

@adorobis
Copy link

adorobis commented Sep 7, 2022

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

@chpego
Copy link
Contributor

chpego commented Sep 7, 2022

Nice job Charles !!! 🥰

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

@KNXBroker
Copy link

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

@cgarwood
Copy link
Owner Author

cgarwood commented Sep 7, 2022

@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.

@DavidDeSloovere
Copy link

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

@h4nnes
Copy link

h4nnes commented Sep 8, 2022

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!

@felipecrs
Copy link

I'm on the same situation :)

@felipecrs
Copy link

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

@DavidDeSloovere
Copy link

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

@felipecrs
Copy link

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

@mclever
Copy link

mclever commented Sep 9, 2022

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.

@shred86
Copy link

shred86 commented Sep 10, 2022

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.

@ayw93
Copy link

ayw93 commented Sep 11, 2022

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!

@PexJensen
Copy link

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

@DavidDeSloovere
Copy link

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)

@adorobis
Copy link

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

@Protoncek
Copy link

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.

@bcutter
Copy link

bcutter commented Dec 4, 2022

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 home-assistant/core#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 home-assistant/core#83260
➡ Update: My fault, I'm still on HA Core 2022.9.7 and according to #118 (comment) 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 #118 (comment) 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.

@adorobis
Copy link

adorobis commented Dec 4, 2022

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
Copy link

adorobis commented Dec 4, 2022

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

@bcutter
Copy link

bcutter commented Dec 4, 2022

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 #118 (comment) 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.

@adorobis
Copy link

adorobis commented Dec 4, 2022

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.

@bcutter
Copy link

bcutter commented Dec 4, 2022

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 home-assistant/core#83260.
I'm on HA Core 2022.9.7 now.

Also filed an issue for the media player always in playing state at home-assistant/core#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. 👍👍👍

@adorobis
Copy link

adorobis commented Dec 4, 2022

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
Copy link

adorobis commented Dec 4, 2022

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

@Protoncek you can just rename each entity_id as well

@bcutter
Copy link

bcutter commented Dec 4, 2022

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!

@Protoncek
Copy link

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

@adorobis
Copy link

adorobis commented Dec 5, 2022

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

@Protoncek
Copy link

Protoncek commented Dec 5, 2022

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests