I really like the new(ish) dashboard feature, but it did not quite go far enough for me. I like Nymea but miss the Openhab display. so I have made my own using dashboards as a base.
Using the JSONRPC I have got the app to load dashboard folders as rooms. then within the rooms I have fragments that load depending on the things with in that folder.
I have the switches wired up to action events so they function, just need to get notifications wired up so the Things update in real time.
Would you mind sharing the code changes? Id like to check it out and maybe get some inspiration from it for future Features to the dashboard.
Now I think this is somewhat too specific to be included in the upstream app as is, however I could try to make adding such modifications easier. For instance I could allow loading qml files with such content without having to recompile the app. That way you could still upgrade the app while keeping your custom dashboard working (unless some bigger API changes would break it, but that should be quite rare).
Thanks I can share the code on my github. However it is a native Java app for android rather than an extension to the existing fronted. This could be achieved in the existing dashboard setup if you could change how the things are displayed. I don’t know qt. But would it be possible to have multiple views for a thing?
I have a couple of cheap amazon fire 7 tablets that I intend to wall mount when we move to our new house. These will be used to control our Tuya light switches and some of my custom smarter plugs and environment monitors
Oh, I see. Nice work!
Just wondering, how are you dealing with the tablet screen auto-off and stuff? Does this app keep the display always on or does one need to press the power button to wake it up? I always found that very annoying when playing with wall mounted tablets (which is why I went for Raspberry Pis with touch screen instead - as nymea:app can take full control of the display without having to mod android with root access and whatnot).
can you elaborate on that please?
This is interesting. How is possible to get those things from nymea:core into a native android app?
As Michael has stated using the JSONRPC is quite straight forward. we have recently moved house and I managed to tear my Achilles tendon so have had a bit of time on my hands to rework this.
I have used OpenHab and Domoticz in the past, these have room dashboards which is basically a group of sensors for an area. I like the simplicity of Nymea and wanted this sort of functionality in it. The app has a house class which loads the dashboard JSON as Rooms. it then loads the things in the rooms into a Thing class with a state listener when Nymea pushes out a state change the listener picks up the state change for that Thing and changes the value accordingly.
I order to keep the tablet awake I just grab a wake lock at app start, this seems to do the business.
@sidney Can you share the android app’s code from the github?
I need an example of how JSONRPC API works. More specific how the android apps communicates with nymea:core
I will dig the project out of archive and upload to github for you when i get the chance. My workshop roof leaked in some heavy rain and wiped out my nymea setup. I have moved to home assistant as it is more automation focused
Ahh…I thought it’s on github already
here you go
It is not finished but should give you a start, the biggest headache with android is that you can’t do websocket stuff on the same thread as the UI. This version uses interface listeners which call back to the UI. which works well except the old tablet I ran it on would randomly drop the wifi and disconnect the listeners.
If you fire up the debug interface on Nymea you can get a lot of info from the log console, if you strip it right down so it just shows JSON RPC, it will show you what you are sending to Nymea and what it is sending back.
Your first action is going to be sending ehlo to nymea and then login.
If you need any help then message me and I will try my best. I have moved to Home Assistant as I was having problems with the Tuya plugin and nearly all my light switch real estate is Tuya and Home Assistant have a local Tuya plugin so no need to rely on the webservice.
Thank you @sidney
I have the same problem with the MQTT service running on the old android tablet. It randomly disconnect the listener. I would give a try with websockets and nymea.
I’ll keep you informed.
Ah that nasty tuya stuff… Yes. The online service is really crappy. I’d love to see a offline tuya plugin happening but I threw out all the tuya wifi devices here… Out of curiosity: Afaik, you need to extract an encryption key from the devices. How is that done nowadays?
I use blue stacks with SmartLife installed, hook up the switch to smart life then extract the local key from the JSON stored on blue stacks. it’s a bit of a hack but works.