Git Product home page Git Product logo

Comments (34)

joBr99 avatar joBr99 commented on August 25, 2024

it's impossible to create a dropdown menu with nextion screens, but I will see what I can do

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

callback bug should be fixed in v1.8.4

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

@hatran0884
on current main/dev version
2022-03-27_15h41_18

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

looks great, i guess we can change the device by that arrow ?

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

Just update in HACS to main (redownload, select main, wait a sec until HACS finished loading, press download) and try yourself. Arrow let's select you a speaker, click on the name of the speaker to confirm the change. (Not really intuitive, but no idea to make it better)

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

Just updated but my unit doesnt show the speaker, i have updated both hacs and nspanel.tft. What might be wrong?
66DD3495-382F-4CCC-8FE1-BE1F7C4FA3FD

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

Strange, did you restart AppDeamon?

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

yes, i forgot to restart Appdaemon, now its working. the problem is now the media card is unable to play spotify songs by itself, i will have to start playing by smartphone first. it happens both on HASS and this media page. so i guess it is the problem of spotify component itself.
i have a BOSE soundtouch and it has an entity named media_player.soundtouch, so i am thinking is it okay to have another media page for this device and then i can play spotify indirectly through this device ?

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

yes, I'm just using the HomeAssistant API, so this is a limitation of the spotify integration in HA

it doesn't have to be spotify, that's just the only thing I can test with, you can use any media_player in HA

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

i have just tried and it worked, however it brings up another small issue, this soundtouch media player has a power button, on HASS dasboard, i will have to turn it on first to play spotify, so could you pls add a power button on the media page ? the spotify media page should be distingushed from other media page, so only spotify page should have a speaker selection and should not have a power button.
sorry if i have requested too much, it is up to you to code it further.

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

I don't have such a speaker can you send pictures of the development section in Homeassistent in different states of that speaker (off, on, playing)

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

Here u go, it seems it does not have an ON state, whenever i turn it on, its state changes to playing.
Uploading 40A99F1E-707C-4403-9EFE-AF804CBF14D8.jpeg…

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

5BE9DEF5-4049-49F9-A4AE-5EB717770861
9F4EED94-393C-4657-86BF-B4B349FA1DE0

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

No idea how to detect if the device has the capability to turn it on or off.

Would this be a Solution? Could simply turn it on in case it's off

        if button_type == "media-pause":
            player = self._ha_api.get_entity(entity_id)
            if player.state == "off":
                player.call_service("turn_on")
            player.call_service("media_play_pause")

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

it should be okay, any chance I can test it now ?

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

This change is pushed, just update to main

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

it worked like a charm, i just need to press play button to turn on the media player and start playing songs, but there is a litte issue with the speaker selector, this media player has 03 selections: AUX, Bluetooth and Spotify, but if i change to AUX or Bluetooth, the Spotify will disappear and i wont be able to change it back to Spotify. So could you code to remove the speaker selector or has an option in the config to disable this selector ?
JPEG image 2

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

the selector will be displayed if there is more than one source in this list

image

as you can see spotify isn't in that list, so it's also not selectable

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

Yes, there are actually 4 modes : AUX, Bluetooth, Airplay and Spotify, but the modes: Airplay and Spotify will only be visible once the smartphone or iphone actives that mode. or if the bose soundtouch is off and then turns on, it will change to Spotify.
thats why i was asking if you could make an option in the config to disable or hide this selector? or create a power button.

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

page should now show a power button if the device supports it, but I cannot test that, because I don't have such a device, if it's not working I will release a bugfix for v1.9.1

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

i have just tested , the power button does not show on the media page. and the play button also does not turn it on to play.

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

can you send me the mqtt message that is generated for the media page from the appdaemon log

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

here is what i got from Appdaemon log:

2022-03-29 20:57:00.014358 INFO nspanel: Sending MQTT Message: time,20:57

2022-03-29 20:56:11.617634 INFO nspanel: Sending MQTT Message: entityUpd,|media_player.soundtouch_living_room|Soundtouch Living Room|0|||0|9||AUX?BLUETOOTH|disable
2022-03-29 20:56:11.607027 INFO nspanel: Started rendering of page 2 with type cardMedia
2022-03-29 20:56:07.805965 INFO nspanel: Sending MQTT Message: weatherUpdate,?12?21.4��C?Wed?12?27.8 ��C?Thu?20?29.2 ��C?Fri?20?22.6 ��C?Energy?32?10.23 kWh
2022-03-29 20:56:07.799205 INFO nspanel: Forecast 1 is overrriden with {'sensor.nang_luong_hom_nay': {'name': 'Energy', 'icon': 'solar-power'}}
2022-03-29 20:56:07.788105 INFO nspanel: Received Message from Screen: event,screensaverOpen
2022-03-29 20:56:04.068900 INFO nspanel: Sending MQTT Message: entityUpd,|media_player.soundtouch_living_room|Soundtouch Living Room|0|AMEE - thay m���i c�� g��i y��u anh|AMEE|25|8|SPOTIFY|AUX?BLUETOOTH|disable
2022-03-29 20:56:04.058851 INFO nspanel: Started rendering of page 2 with type cardMedia
2022-03-29 20:56:00.014374 INFO nspanel: Sending MQTT Message: time,20:56
2022-03-29 20:55:51.781165 INFO nspanel: Sending MQTT Message: entityUpd,|media_player.soundtouch_living_room|Soundtouch Living Room|0|||25|9|INVALID_SOURCE|AUX?BLUETOOTH|disable
2022-03-29 20:55:51.760638 INFO nspanel: Sending MQTT Message: pageType,cardMedia
2022-03-29 20:55:51.756971 INFO nspanel: Started rendering of page 2 with type cardMedia
2022-03-29 20:55:51.753951 INFO nspanel: Button Press Event; entity_id: screensaver; button_type: bExit; value: 1

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

can you update to v2.0.0 and try again?

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

no, unfortunately, still the same, now the switch items also gone and replaced by:
switch
switch
delete

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

i think you dont need to waste your time to create a power button, just go back to the way of pressing the play button to turn it on and play. i am okay with that.

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

did you restart appdaemon?

I implemented it the same way, I did for the alarm panel, it should work ..., waht does the appdaemon log say?

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

sorry, i only updated the display firmware, forgot to update the appdaemon backend. it working now, the power button now shows up but nothing happens when i press this power button.

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

here the appdaemon logs:

022-03-29 21:46:51.572585 INFO nspanel: Button Press Event; entity_id: media_player.soundtouch_living_room; button_type: media-OnOff; value: None

2022-03-29 21:46:51.569402 INFO nspanel: Received Message from Screen: event,buttonPress2,media_player.soundtouch_living_room,media-OnOff
2022-03-29 21:46:50.881949 INFO nspanel: Button Press Event; entity_id: media_player.soundtouch_living_room; button_type: media-pause; value: None
2022-03-29 21:46:50.872052 INFO nspanel: Received Message from Screen: event,buttonPress2,media_player.soundtouch_living_room,media-pause
2022-03-29 21:46:50.061881 INFO nspanel: Button Press Event; entity_id: media_player.soundtouch_living_room; button_type: media-pause; value: None
2022-03-29 21:46:50.059039 INFO nspanel: Received Message from Screen: event,buttonPress2,media_player.soundtouch_living_room,media-pause
2022-03-29 21:46:49.749979 INFO nspanel: Button Press Event; entity_id: media_player.soundtouch_living_room; button_type: media-back; value: None
2022-03-29 21:46:49.746960 INFO nspanel: Received Message from Screen: event,buttonPress2,media_player.soundtouch_living_room,media-back
2022-03-29 21:46:49.534696 INFO nspanel: Button Press Event; entity_id: media_player.soundtouch_living_room; button_type: media-next; value: None
2022-03-29 21:46:49.531916 INFO nspanel: Received Message from Screen: event,buttonPress2,media_player.soundtouch_living_room,media-next
2022-03-29 21:46:49.504115 INFO nspanel: Button Press Event; entity_id: media_player.soundtouch_living_room; button_type: media-pause; value: None
2022-03-29 21:46:49.501396 INFO nspanel: Received Message from Screen: event,buttonPress2,media_player.soundtouch_living_room,media-pause
2022-03-29 21:46:48.530273 INFO nspanel: Button Press Event; entity_id: media_player.soundtouch_living_room; button_type: media-OnOff; value: None
2022-03-29 21:46:48.527600 INFO nspanel: Received Message from Screen: event,buttonPress2,media_player.soundtouch_living_room,media-OnOff
2022-03-29 21:46:48.502761 INFO nspanel: Button Press Event; entity_id: media_player.soundtouch_living_room; button_type: media-pause; value: None
2022-03-29 21:46:48.500101 INFO nspanel: Received Message from Screen: event,buttonPress2,media_player.soundtouch_living_room,media-pause
2022-03-29 21:46:47.590602 INFO nspanel: Button Press Event; entity_id: media_player.soundtouch_living_room; button_type: media-OnOff; value: None

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

hmm, media-OnOff looks good

it's calling the same api I did with the play button before

        if button_type == "media-OnOff":
            if player.state == "off":
                self._ha_api.get_entity(entity_id).call_service("turn_on")
            else:
                self._ha_api.get_entity(entity_id).call_service("turn_off")

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

nevermind found the issue, update to v2.0.1, restart appdaemon and try again

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

yes, now the button works but only with turn off event, whenever i press turn on, the source says: invalid_source, then i tried to turn it on by HASS dashboard, the media player turns to unavailable. i checked the HASS log and found this:
Soundtouch Living Room became unavailable by Tran Manh Ha
i tried to restart HASS without help, i am not sure if this NSpanel version is doing smt that causes the media player to become unavailble ? i remember yesterday i can easily turn on or turn off this media player using HASS dashboard without issue.
pls correct me if i am wrong

from nspanel-lovelace-ui.

joBr99 avatar joBr99 commented on August 25, 2024

it's calling the exact same api from HA

this is the power button:

        if button_type == "media-OnOff":
            if player.state == "off":
                self._ha_api.get_entity(entity_id).call_service("turn_on")
            else:
                self._ha_api.get_entity(entity_id).call_service("turn_off")

and the play button did somthing like this

if player.state == "off":
     self._ha_api.get_entity(entity_id).call_service("turn_on")

does it also become unavalibe when you are calling the turn_off service from HA developer tools?

from nspanel-lovelace-ui.

hatran0884 avatar hatran0884 commented on August 25, 2024

strange, i tried to call turn off and turn on services from HA developer tools for a few times, now i can turn on and turn off the media player using both HA and NSpanel without issue. so i will keep testing it further. thank you

from nspanel-lovelace-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.