DewGew / DZGA-Flask

Domoticz Google Assisting using Flask
GNU General Public License v3.0
8 stars 4 forks source link

Feature Request: Enable or disable devices to sync with Google Assistant #69

Closed Xavier82 closed 6 months ago

Xavier82 commented 6 months ago

In the old DZGA version there was a feature to disable specific devices (based on IDX) so they won't sync to Google Assistant. How can this be done in DZGA-flask?

I have many devices which I don't want to be synced to Google Assistant (like temp, power, voltage). I would like to exclude these devices.

Maybe as a new feature a on/off button per each device to enable or disable the sync to Google Assitant?

DewGew commented 6 months ago

Same function as in old dzga: https://github.com/DewGew/DZGA-Flask/wiki/3.-Configuration

<voicecontrol>
   hide = True
</voicecontrol>

But there is hide function in the ui also. In device page click the blue link under 'Type' for the device you want to hide in the devicelist

Type

device settings

Xavier82 commented 6 months ago

Thanks for the reaction, when using the hide button and saving changes the window closes, when reopening the the setting I made (hide enabled) is not saved.... bug?

There is nothing in the logg about the save of this action (or error). Pressed also sync devices and the device which I enabled to hide is still shown in Google assitant.

DewGew commented 6 months ago

I can't reproduce this issue. For me it works, if you hit F12 in your browser and click console do you get any errors?

Xavier82 commented 6 months ago

This is the error: image

Used multiple browsers (Chrome, Edge, FireFox), all same issue. Settings are not saved/stored.

DewGew commented 6 months ago

I dont get those errors. get latest verison from gitub v23.11

Xavier82 commented 6 months ago

I'm completely lost now.....

I removed the entire DZGA-Flask as written in the wiki. Then I rebooted the RPi. I reinstalled DZGA-Flask as written in the wiki.

I entered the information in user settings. Saved the credentials, restarted DZGA-Flask. Logged back in again.

Under information I now see: DZGA-Flask Version: Not available Domoticz Version: Not available

And in the logging I now see: 2023-12-15 15:45:06 Starting new HTTP connection (1): DomoticzIP:DomoticzPort 2023-12-15 15:45:06 http://DomoticzIP:DomoticzPort "GET //json.htm?type=command&param=getdevices&plan=0&filter=all&used=true HTTP/1.1" 404 85 2023-12-15 15:45:06 Error connection to domoticz!

Devices folder and file is empty.

I then created new user in Domoticz with new password (both simple no specific characters). I use the admin account in DZGA-Flask. No fix.

Since I do this on my test server Rpi4B Bullseye (DZGA-Flask 23.11 and Domoticz 2023.2 beta 15727) I adjusted it to my production server Rpi3B Bullseye (DZGA-Flask 23.11 and Domoticz 2023.2 Stable). This doesn't work neither. In both setups I don't get to see the DZGA-Flask version, nor the Domoticz version.

I then created a new user on DZGA-Flask with the same username and password as in Domoticz. Logged back in with newly created user and I now get the DZGA-Flask version and Domoticz Version. I now also even get the devices! Seems like there is some issue with the default admin user in DZGA-Flask.

In this situation (newly created user in DZGA-Flask 23.11 and newly created user in Domoticz 2023.2 beta) I can connect to Domoticz and I get data, but I still can't "hide" devices. This setting is not being saved. In which file is this saved? In the $username_devices.json file in the /home/USER/DZGA-Flask/config/ folder?

Pressing the "Reset" buttons doesn't change any data. Data remains the same (my expectation is that "Reset" cleans out the form and all fields become empty)

Xavier82 commented 6 months ago

UPDATE: I found that settings are updated (hidden) when "Device Sync" has been done. Then I can see in the Dashboard that device is hidden, also under "devices" in the column "Type" it shows devicenaam_hidden.

Purhaps an idea to update the Wiki with this information/step to clearify devices will be hidden after device sync.