Page 1 of 1
Update switch from XML (Frontier)
Posted: Saturday 28 October 2017 13:12
by woods
Hi all,
first of all I would like to thank you all for creating this community. It's really helpful for us so called 'noobs'.
I have a radio (Pinell SuperSound II) that communicates through Frontier.
As of now I can switch the radio on/off, select volume, change channels and so forth. Everything is done through http requests. For example:
Code: Select all
http://192.168.1.150/fsapi/SET/netRemote.sys.power?pin=1234&value=1
turns on my radio. This is done through http req field in the switch config.
Goal
Updating the virtual switch based on information through XML (this is a new field for me, I apologize if I use the wrong terms). I simply want Domoticz to update the switch status if the radio physically get's powered on.
What I know so far
The following http request:
Code: Select all
http://192.168.1.150/fsapi/GET/netRemote.sys.power?pin=1234
gives the following information:
Code: Select all
<fsapiResponse>
<status>FS_OK</status>
<value>
<u8>1</u8>
</value>
</fsapiResponse>
.extraClassAspect {-webkit-transform: scaleX(1.35)!important;}.extraClassCrop {-webkit-transform: scale(1.35)!important;}
The "<u8>1</u8>" part shows if the radio is powered on (
1) or not (
0). I would like Domoticz to check this status every minute or something. Is this possible somehow?
I found some documentation for OpenHab if this could be useful for someone:
https://github.com/openhab/openhab1-add ... io-Binding
Thanks
Regards
Version: 3.8153
Raspberry Pi 2
Hue, Z-wave, RF
Re: Update switch from XML (Frontier)
Posted: Sunday 19 January 2020 10:49
by eddieb
Hi,
did you ever get this working ?
I have this medion audio player which is regognized as a Frontier Silicon device also.
sending
http://<IP>/fsapi/LIST_GET_NEXT/netRemote.sys.caps.validModes/-1?pin=1234&maxItems=65536
gives me a nice XML and it seems controllable.
Would be nice if we got support for this kind of devices somehow like in OpenHab
Eddie
Re: Update switch from XML (Frontier)
Posted: Sunday 19 January 2020 11:07
by waaren
eddieb wrote: ↑Sunday 19 January 2020 10:49
I have this medion audio player which is regognized as a Frontier Silicon device also.
sending http://<IP>/fsapi/LIST_GET_NEXT/netRemote.sys.caps.validModes/-1?pin=1234&maxItems=65536 gives me a nice XML and it seems controllable.
Would be nice if we got support for this kind of devices somehow.
The issue here is not so much to send this API call and interpret the XML that comes back. The real question that needs answering is how to trigger this API call. If the audio player could 'ask' domoticz to do, you would be halfway there. If not,- you would need some kind of polling mechanism. Either in domoticz 'hardware' modules or using a script. (Python, dzVents or other). Setting the polling frequency is then important in terms of performance / response.
Re: Update switch from XML (Frontier)
Posted: Sunday 19 January 2020 11:10
by eddieb
Hi waaren,
tnx for your reply. Nice that I catched your attention
Perhaps you have any suggestions to get this working ?
Eddie
Re: Update switch from XML (Frontier)
Posted: Sunday 19 January 2020 12:17
by waaren
eddieb wrote: ↑Sunday 19 January 2020 11:10
Perhaps you have any suggestions to get this working ?
Sure, if you can send me the xml you receive back from your audio system, -the required frequency and what you want to do with it, I can try to come with a dzVents based polling approach.
Re: Update switch from XML (Frontier)
Posted: Sunday 19 January 2020 12:33
by eddieb
waaren,
the xml only shows the possible selections on the command I sent.
It does not give the current status and/or the possible changes.
It is possible to chang volume and other things. That must be done with some other call. Need to dive into that ...
Code: Select all
<fsapiResponse>
<status>FS_OK</status>
<item key="0">
<field name="id">
<c8_array>IR</c8_array>
</field>
<field name="selectable">
<u8>1</u8>
</field>
<field name="label">
<c8_array>Internetradio</c8_array>
</field>
<field name="streamable">
<u8>1</u8>
</field>
<field name="modetype">
<u8>0</u8>
</field>
</item>
<item key="1">
<field name="id">
<c8_array>Spotify</c8_array>
</field>
<field name="selectable">
<u8>1</u8>
</field>
<field name="label">
<c8_array>Spotify</c8_array>
</field>
<field name="streamable">
<u8>1</u8>
</field>
<field name="modetype">
<u8>0</u8>
</field>
</item>
<item key="2">
<field name="id">
<c8_array>DMR</c8_array>
</field>
<field name="selectable">
<u8>0</u8>
</field>
<field name="label">
<c8_array>DMR</c8_array>
</field>
<field name="streamable">
<u8>1</u8>
</field>
<field name="modetype">
<u8>0</u8>
</field>
</item>
<item key="3">
<field name="id">
<c8_array>MP</c8_array>
</field>
<field name="selectable">
<u8>1</u8>
</field>
<field name="label">
<c8_array>Muziekspeler</c8_array>
</field>
<field name="streamable">
<u8>1</u8>
</field>
<field name="modetype">
<u8>1</u8>
</field>
</item>
<item key="4">
<field name="id">
<c8_array>DAB</c8_array>
</field>
<field name="selectable">
<u8>1</u8>
</field>
<field name="label">
<c8_array>DAB</c8_array>
</field>
<field name="streamable">
<u8>1</u8>
</field>
<field name="modetype">
<u8>0</u8>
</field>
</item>
<item key="5">
<field name="id">
<c8_array>FM</c8_array>
</field>
<field name="selectable">
<u8>1</u8>
</field>
<field name="label">
<c8_array>FM</c8_array>
</field>
<field name="streamable">
<u8>1</u8>
</field>
<field name="modetype">
<u8>0</u8>
</field>
</item>
<item key="6">
<field name="id">
<c8_array>AUXIN</c8_array>
</field>
<field name="selectable">
<u8>1</u8>
</field>
<field name="label">
<c8_array>AUX in</c8_array>
</field>
<field name="streamable">
<u8>0</u8>
</field>
<field name="modetype">
<u8>0</u8>
</field>
</item>
<listend/>
</fsapiResponse>
Re: Update switch from XML (Frontier)
Posted: Sunday 19 January 2020 12:52
by eddieb