Denon AV Reciver - plugin Topic is solved

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

trixwood

Re: Denon AV Reciver - plugin

Post by trixwood »

I am on OSX (or iOS) so there you would use the LaunchControl to make a cron job.

There seems to be an excellent wiki page

https://www.domoticz.com/wiki/Domoticz_and_Scripting

or an example of cron (scroll down to see cron help)

https://www.domoticz.com/wiki/Presence_detection

the crontabe code you will add probably will look like

Code: Select all

*/10 * * * *  /home/pi/domoticz/scripts/denon.sh
which runs it every 10 seconds... ofcourse you can run it manually, how else would you debug it :-)
try removing the part which redirects output to the void

Code: Select all

&> /dev/null
or try printing a variable

Code: Select all

echo $AVvolume

Hope that helps... time for my favorites slow break! breakfast!
trixwood

Re: Denon AV Reciver - plugin

Post by trixwood »

Hoop dat het werkt iedergeval ;-)

Update just found out that it is probably handy to check the current value and only send value that are changed,... going to implement that tonight :-)
I'm only using domoticz for two weeks now. So bear with me.
trixwood

Re: Denon AV Reciver - plugin

Post by trixwood »

Updated the denon script. Now it only change values when they are changed, not like the first version which updates everything every 10 seconds.
xces
Posts: 39
Joined: Thursday 05 February 2015 9:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Denon AV Reciver - plugin

Post by xces »

Where can we find the latest version of the Denon script?
trixwood

Re: Denon AV Reciver - plugin

Post by trixwood »

In this thread, but I haven't worked on it. You can expand and modify it very easily, all the docs/links are there and with a little copy/paste :-). Note that the script is compatible with 1912av for other models you still have to mod things...

0.2b is currently the latest.

I'v been working on virtual power and enery sensors for my hue lights :-) Almost working perfectly...

viewtopic.php?f=23&t=11778&p=84624&hili ... hue#p84624

Sleepy Time!
trixwood

Re: Denon AV Reciver - plugin

Post by trixwood »

Found link to implement volume control through a dimmer... going to try this weekend :-)

https://translate.google.nl/translate?h ... oticz.html

And then implement the radio... maybe :-)
trixwood

Re: Denon AV Reciver - plugin - Dimmer Volume Control

Post by trixwood »

Volume Control

Above 70% is loud!!!

Instructions

* Create a virtual device dimmer switch called "Denon Volume" (if you followed guide to the v0.2 script you already have one)
* if you followed guide to the v0.2 script delete the mute virtual sensor it is now incorporated in the volume device
* use the new script
* Change the denon.sh script that both the mute & the volume devices point to "Denon Volume"
* http://ip.or.host.here.local/MainZone/i ... Mute%2Foff in the on action
* http://ip.or.host.here.local/MainZone/i ... eMute%2Fon in the off action
* Add lua code to your device events

Code: Select all

commandArray = {} 

-- very laze here assume relative volume setting on the denon amp...

IP = '10.0.0.91'

if devicechanged['Denon Volume'] then 
  NewLevel = otherdevices_svalues['Denon Volume'] 
  if NewLevel ~= "Off" and NewLevel ~= "0" then  
    SendLevel = NewLevel - 79.5
    os.execute ("curl http://" .. (IP) .. "/MainZone/index.put.asp?cmd0=PutSystem_OnStandby%2FON")
    os.execute ("curl http://" .. (IP) .. "/MainZone/index.put.asp?cmd0=PutVolumeMute%2Foff")    
    os.execute ("curl http://" .. (IP) .. "/MainZone/index.put.asp?cmd0=PutMasterVolumeSet/" .. (SendLevel))
  end
end 
return commandArray
The new script to handle mute/volume change correctly

Code: Select all

#!/bin/bash
#
# Domoticz Denon Script
# ---------------------
#
# Created 2016 Trixwood
#
# 0.1 first try
# 0.2 TC only update when needed
# 0.3 Mute & Volume feature
#
#
# to do: check if domoticz online else do not send anything
#
# Enable debug remove the # from the echo's (only volume uses echo... will change that todo ;-)

# Settings
DOMO_IP="10.0.0.1"            # Domoticz IP Address
DOMO_PORT="8090"              # Domoticz Port
DENONIP="10.0.0.91"           # Denon IP Address
DENON_IDX="155"               # On/Off    (Switch) IDX *1
DENON_STATUS_IDX="290"        # Status    (Text) IDX
DENON_MUTE_IDX="117"         # Absolute Volume (Slider) IDX (same as Absolute Volume)
DENON_VOL_REL_IDX="59"        # Relative Volume (Sound Volume) IDX
DENON_VOL_ABS_IDX="117"       # Absolute Volume (Slider) IDX
DENON_SURROUND_IDX="149"      # Surround  (Selector Switch) IDX
DENON_INPUT_IDX="133"         # Input     (Selector Switch) IDX *1
DENON_NET_INPUT_IDX="289"     # Net input (Text) IDX
DENON_AIRPLAY_IDX="150"       # Airplay?  (Switch)

# *1 You need additional virtual device which this one is a slave
# use ip for domoticz not the hostname, else password protection will fail…

# Selector Switches with 13 entries from -6db -5db .. -1db 0db .. 6db
#DENON_BASS_IDX="287"          # BASS (Selector Switch) IDX
#DENON_TREBLE_IDX="288"        # TREBLE (Selector Switch) IDX

# check if receiver in online
PINGTIME=`ping -c 1 -q $DENONIP | awk -F"/" '{print $5}' | xargs`

#
# Default Values
# todo only update when value changed... sleepy time now ;-)
#
function defaulting {

  #echo Defaulting...  
  curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DENON_STATUS_IDX&nvalue=0&svalue=No%20Denon%20Detected" &> /dev/null
  curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_AIRPLAY_IDX&switchcmd=Off" &> /dev/null
 # curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_MUTE_IDX&switchcmd=On" &> /dev/null
  curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_IDX&switchcmd=Off" &> /dev/null
  curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DENON_VOL_REL_IDX&nvalue=0&svalue=-80.5" &> /dev/null
  curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_VOL_ABS_IDX&switchcmd=Set%20Level&level=0" &> /dev/null

}


# we can ping the machine
if expr "$PINGTIME" '>' 0
then

  # is there a denon?
  AVexists=$(curl -s http://$DENONIP/goform/formMainZone_MainZoneXml.xml | tee denon.mainzone.settings | grep "<Power><value>" &> /dev/null)
  
  # yes!
  if [ $? -eq 0 ] ; then
    
    #
    # Airplay
    # -------
    #
    # 

    # decode new value
    curl -s http://$DENONIP/goform/formNetAudio_StatusXml.xml > denon.net.settings
    AVairplay=$(grep -Eo "AirPlay" < denon.net.settings)
    

    # decode old value
    AVairplayold=$(curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$DENON_AIRPLAY_IDX" | grep Status)
    AVairplayold=${AVairplayold##*Status\" : \"}
    AVairplayold=${AVairplayold//\",/}

    #echo "Airplay: $AVairplay ($AVairplayold)" 

    if [ "$AVairplay" == "AirPlay" ]; then
      if [ "$AVairplayold" == "Off" ] ; then
        #echo "Airplay: Switching On"
        curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_AIRPLAY_IDX&switchcmd=On" &> /dev/null
      fi 
    else
    if [ "$AVairplayold" == "On" ] ; then
        #echo "Airplay: Switching Off"
        curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_AIRPLAY_IDX&switchcmd=Off" &> /dev/null
      fi 
    fi

    #
    # Mute
    # ----
    #
   
    # decode new value
    AVmute=$(sed -n -e 's/.*\<Mute><value>\(.*\)<\/value>.*/\1/p' denon.mainzone.settings)

    # decode old value
    AVmuteold=$(curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$DENON_MUTE_IDX" | grep "Status")
    AVmuteold="${AVmuteold##*Status\" : \"}"
    AVmuteold=${AVmuteold//\",/}

    #echo "Mute: $AVmute ($AVmuteold)"
    
    # only switch when value is changed
    if [ "$AVmute" == "on" ] && [ "$AVmuteold" != "Off" ] ; then
      curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_MUTE_IDX&switchcmd=Off" &> /dev/null
      #echo "Mute: Switching On"
    fi
    if [ "$AVmute" == "off" ] && [ "$AVmuteold" == "Off" ] ; then
      curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_MUTE_IDX&switchcmd=On" &> /dev/null
      #echo "Mute: Switching Off"
    fi

    #
    # Volume
    # ----------
    #
    # Note that Denon Can So 0.5 steps of Decibel is set to Relative that means with relative you have twice the amount of resolution
    # So resolution will be lost if your denon is set to relative volume since the slider only half the resolution and sound volume 
    # does not have half steps
    # 
    # Range Relative -80.5 dB to +18
    #       Absolute 0..99
    #
    # that will not convert well :-/

    # decode new value
    AVisvolumerelative=$(sed -n -e 's/.*\<VolumeDisplay><value>\(.*\)<\/value>.*/\1/p' denon.mainzone.settings)
    AVvolume=$(sed -n -e 's/.*\<MasterVolume><value>\(.*\)<\/value>.*/\1/p' denon.mainzone.settings)

    # compensate for Denon Volume setting    
    
      if [ "$AVvolume" == "--" ] ; then
          AVvolume="0"
          AVisvolumerelative="Infinity"
     fi
   
    if [ "$AVisvolumerelative" == "Relative" ] ; then
      #echo "Volume: Relative"
      AVvolumeAbs=$(echo "80.5 + $AVvolume" | bc) 
      AVvolumeRel=$AVvolume
    else
      #echo "Volume: Absolute"
      AVvolumeRel=$(echo "80.5 - $AVvolume" | bc) 
      AVvolumeAbs=$AVvolume
    fi

    # exterminate, exterminate, convert... convert...
    AVvolumeAbs=$((${AVvolumeAbs//\./}/10))

    # decode old value
    AVvolumeoldAbs=$(($(curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$DENON_VOL_ABS_IDX" | grep Data | grep -Eo '[0-9]{1,4}')+1))
 
    #echo "Volume: $AVvolumeRel db $AVvolumeAbs ($AVvolumeoldAbs)" 

    # only switch when value is changed
    if [ "$AVmute" == "off" ] && [ "$AVvolumeAbs" != "$AVvolumeoldAbs" ]; then
      #echo "Volume: Switching $AVvolumeRel db $AVvolumeAbs"
      curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DENON_VOL_REL_IDX&nvalue=0&svalue=$AVvolumeRel" &> /dev/null
      curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_VOL_ABS_IDX&switchcmd=Set%20Level&level=$AVvolumeAbs" &> /dev/null
    fi  
  
# CHECK FOR OLD VALUE FIRST!!!! FIX FIX  
     if [ "$AVmute" == "on" ] ; then
       curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DENON_VOL_REL_IDX&nvalue=0&svalue=$AVvolumeRel" &> /dev/null


    fi  


    #
    # Net Source
    # ----------
    #
    # 

    # decode new value
    AVnet=$(sed -n -e 's/.*\<NetFuncSelect><value>\(.*\)<\/value>.*/\1/p' denon.mainzone.settings)

    # decode old value
    AVnetold=$(curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$DENON_NET_INPUT_IDX" | grep Data)
    AVnetold="${AVnetold##*Data\" : \"}"
    AVnetold=${AVnetold//\",/}

    #echo "Net Input: $AVnet ($AVnetold)" 

    # only switch when value is changed
    if [ "$AVnet" != "$AVnetold" ]; then
      #echo "Net Input: Switching $AVnet"
      curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DENON_NET_INPUT_IDX&nvalue=0&svalue=$AVnet" &> /dev/null
    fi

    #
    # Source Input
    # ------------
    #

    # decode new value
    AVinput=$(sed -n -e 's/.*\<InputFuncSelect><value>\(.*\)<\/value>.*/\1/p' denon.mainzone.settings)
    # AVswitchlevel=0
    if [ "$AVinput" == "GAME" ] ; then
      AVswitchlevel=10
    fi
    if [ "$AVinput" == "GAME2" ] ; then
      AVswitchlevel=20
    fi
    if [ "$AVinput" == "TUNER" ] ; then
      AVswitchlevel=30
    fi
    if [ "$AVinput" == "DVD" ] ; then
      AVswitchlevel=40
    fi
    if [ "$AVinput" == "SAT" ] ; then
      AVswitchlevel=50
    fi
    if [ "$AVinput" == "BD" ] ; then
      AVswitchlevel=60
    fi
    if [ "$AVinput" == "TV" ] ; then
      AVswitchlevel=70
    fi
    if [ "$AVinput" == "CD" ] ; then
      AVswitchlevel=80
    fi
    if [ "$AVinput" == "V.AUX" ] ; then
      AVswitchlevel=100
    fi
    if [ "$AVinput" == "DOCK" ] ; then
      AVswitchlevel=110
    fi
    if [ "$AVinput" == "SOURCE" ] ; then
      AVswitchlevel=120
    fi
    if [ "$AVinput" == "NET/USB" ] ; then
      AVswitchlevel=90
    fi

    # decode old value
    AVinputold=$(curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$DENON_INPUT_IDX" | grep Status | grep -Eo '[0-9]{1,4}' )
    #echo "Input: $AVswitchlevel ($AVinputold)" 

    # only switch when value is changed
    if [ "$AVswitchlevel" != "$AVinputold" ]; then
      #echo "Input: Switching $AVinput"
      curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_INPUT_IDX&switchcmd=Set%20Level&level=$AVswitchlevel" &> /dev/null
    fi

    #
    # Surround
    # --------
    #

    # decode new value
    AVsurround=$(sed -n -e 's/.*\<selectSurround><value>\(.*\)<\/value>.*/\1/p' denon.mainzone.settings | sed -e 's/[[:space:]]*$//') 
    if [ "$AVsurround" == "STEREO" ] ; then
      AVswitchlevel=10
    fi
    if [ "$AVsurround" == "DIRECT" ] ; then
      AVswitchlevel=20
    fi
    if [ "$AVsurround" == "DOLBY DIGITAL" ] ; then
      AVswitchlevel=40
    fi
    if [ "$AVsurround" == "PURE DIRECT" ] ; then
      AVswitchlevel=30
    fi
    if [ "$AVsurround" == "DTS SURROUND" ] ; then
      AVswitchlevel=50
    fi
    if [ "$AVsurround" == "MCH STEREO" ] ; then
      AVswitchlevel=60
    fi
    if [ "$AVsurround" == "MONO MOVIE" ] ; then
      AVswitchlevel=70
    fi
    if [ "$AVsurround" == "VIDEO GAME" ] ; then
      AVswitchlevel=80
    fi
    if [ "$AVsurround" == "JAZZ CLUB" ] ; then
      AVswitchlevel=90
    fi
    if [ "$AVsurround" == "ROCK ARENA" ] ; then
      AVswitchlevel=100
    fi
    if [ "$AVsurround" == "VIRTUAL" ] ; then
      AVswitchlevel=110
    fi
    if [ "$AVsurround" == "MATRIX" ] ; then
      AVswitchlevel=120
    fi

    # decode old value
    AVsurroundold=$(curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$DENON_SURROUND_IDX" | grep Status | grep -Eo '[0-9]{1,4}' )
    #echo "Surround: $AVswitchlevel ($AVsurroundold)" 

    # only switch when value is changed
    if [ "$AVswitchlevel" != "$AVsurroundold" ]; then
      #echo "Surround: Switching $AVsurround"
      curl  -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_SURROUND_IDX&switchcmd=Set%20Level&level=$AVswitchlevel" &> /dev/null
    fi

    #
    # Status
    # ------
    #

    # decode new value
    AVstatus=$(sed -n -e 's/.*\<Power><value>\(.*\)<\/value>.*/\1/p' denon.mainzone.settings)

    # decode old value
    AVstatusold=$(curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$DENON_IDX" | grep Status)
    AVstatusold="${AVstatusold##*Status\" : \"}"
    AVstatusold=${AVstatusold//\",/}
        
    #echo "Power: $AVstatus ($AVstatusold)"

    # only switch when value is changed
    if [ "$AVstatus" == "ON" ] && [ "$AVstatusold" == "Off" ] ; then
      #echo "Power: Switching On"
      curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_IDX&switchcmd=On" &> /dev/null
    fi

    if [ "$AVstatus" == "STANDBY" ] && [ "$AVstatusold" == "On" ] ; then
      #echo "Power: Switching Off"
      curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_IDX&switchcmd=Off" &> /dev/null
    fi

    if ([ "$AVstatus" == "ON" ] && [ "$AVstatusold" == "Off" ]) || ([ "$AVstatus" == "STANDBY" ] && [ "$AVstatusold" == "On" ]) ; then
       #echo "Power: Status Updated"
       curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DENON_STATUS_IDX&nvalue=0&svalue=$AVstatus" &> /dev/null
    fi



    #
    # Cleaning Up
    #

    #rm denon.mainzone.settings
    #rm denon.net.settings


 # Bass
 #   AVbass=$(./denon.telnet.sh PSBAS ? | sed 's/PSBAS //' | grep -Eo '[0-9]{1,4}')
 #   AVbass=$(((AVbass-43)*10)) 
 # if [ "$AVbass" == "-430" ] ; then
 #    #echo ""
 # else
 #   curl  -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_BASS_IDX&switchcmd=Set%20Level&level=$AVbass" &> /dev/null
 # fi 
 # only one telnet allowed :-/
 #  sleep 2
 # Treble
 #    AV=$(./denon.telnet.sh PSTRE ?)
 ##echo $AV
 # sleep 2
 #   AVtreble=$(./denon.telnet.sh PSTRE ? | sed 's/PSTRE //' | grep -Eo '[0-9]{1,4}')
 #   AVtreble=$(((AVtreble-43)*10))
 #   if [ "$AVtreble" == "-430" ] ; then
 #      #echo ""
 #   else
 #   curl  -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$DENON_TREBLE_IDX&switchcmd=Set%20Level&level=$AVtreble" &> /dev/null

 #  fi 

  else
    # no denon xml from http server do something!
    defaulting 
  fi
else
  # we could not even ping it defaulting
  defaulting  
fi


Now you have a device that mute and set the volume... :-)
Signed TRiXWooD
Last edited by trixwood on Sunday 28 August 2016 12:38, edited 9 times in total.
trixwood

Bug bug bug...

Post by trixwood »

Also found a bug

I tried this first with two virtual devices like with the denon power switch. Works but it will not update correctly.
The procent number is correct but the slider is not updated when the procent number is updated (through the slave).
Screen Shot 2016-05-09 at 08.55.39.jpg
Screen Shot 2016-05-09 at 08.55.39.jpg (27.29 KiB) Viewed 3631 times
Domoticz V3.5076

Anyway to fix this use one virtual device instead of two. For the moment.
Why use two? Because if you click at the same time it's updated your volume change will be reset to the previous value resulting in no volume change. The only solution was a second virtual dimmer switch with the slave combi... now it seems that for dimmers there is a bug :-) Update tested it: you have to time it, so probably one in every 30 clicks will not work... so i am going to stick with one virtual switch for the moment

We need a denon device :-)
piokuc

Re: Denon AV Reciver - plugin

Post by piokuc »

Hi
Did you know how create virtual device in Domoticz to set for Zone 1 and other to Zone 2 SLEEP TIME in DENON AVR-X2100W ?
trixwood

Re: Denon AV Reciver - plugin

Post by trixwood »

You need telnet for that

look at denon.telnet.sh:

viewtopic.php?f=31&t=11011&start=20#p84408

and look up the protocol the command you need is

disable timer

Code: Select all

./denon.telnet.sh SLPOFF
set timer SLPX where x is number of minutes

Code: Select all

./denon.telnet.sh SLP10
for status

Code: Select all

./denon.telnet.sh SLP?
you can find the denon protocal here:

https://www.google.nl/#q=protocol+denon

don't know if you can also sleep the second zone. could not find it in the protocol description, but you can always make a sleeptimer in domoticz using domoticz timer stuff and an sending an OFF command after a period of time.
piokuc

Re: Denon AV Reciver - plugin

Post by piokuc »

For second zone also can set sleep mode because i use on android app name DENON REMOTE https://play.google.com/store/apps/deta ... remotefree and in this app i can set sleep on main zone and second zone.


Good option will be write plugin for denon to show control panel as is in Domoticz for XBMC Media Player.
trixwood

Re: Denon AV Reciver - plugin

Post by trixwood »

I did a fast, denon protocol search. If they have added it in your model or i did not search very well but i could not find zone 2. You should google it. If that fails ask denon for the protocol description (the dutch denon division where no good got only managers/sellers, you need main denon in japan where they actually build stuff). If that fails use a network sniffer to sniff the connection between that app and your denon. It uses telnet or http request. Out in the clear. So you could read the command from there. Good luck!

I do not know how large the user base is of domoticz, but if it's becoming large enough, you could ask denon if they would support a hardware plugin with money/code? It's in their interest to sell more units.
cattoo
Posts: 60
Joined: Sunday 20 September 2015 17:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3072
Location: Sweden
Contact:

Re: Denon AV Reciver - plugin

Post by cattoo »

I have som issues, just got my hand on a Marantz Stere Receiver, so i thought that i could use this script.
Added all the sensors, but when im trying to run the script manually to confirm that things are working. I got some errors.
Those errors is where the script dont have any inputs. Its just blank?
What to do?

Code: Select all

pi@raspberrypi ~/domoticz/scripts $ bash marantz.sh
marantz.sh: line 16: $'\r': command not found
marantz.sh: line 30: $'\r': command not found
marantz.sh: line 33: $'\r': command not found
marantz.sh: line 37: $'\r': command not found
marantz.sh: line 40: $'\r': command not found
marantz.sh: line 45: syntax error near unexpected token `$'{\r''
'arantz.sh: line 45: `function defaulting {
trixwood

Re: Denon AV Reciver - plugin

Post by trixwood »

Which script are you running telnet or the http one?
cattoo
Posts: 60
Joined: Sunday 20 September 2015 17:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3072
Location: Sweden
Contact:

Re: Denon AV Reciver - plugin

Post by cattoo »

trixwood wrote:Which script are you running telnet or the http one?
The http one
trixwood

Re: Denon AV Reciver - plugin

Post by trixwood »

try removing all

Code: Select all

&> /dev/null
from the code to see it's output.

You do have curl,tee,sed,... installed on your system? Seeing the error you probably missing one of those... (check your output)
cattoo
Posts: 60
Joined: Sunday 20 September 2015 17:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3072
Location: Sweden
Contact:

Re: Denon AV Reciver - plugin

Post by cattoo »

Still the same output!
Hmm, how could i see which one of them are missing?
Btw, im on a raspberry if it matters.
trixwood wrote:try removing all

Code: Select all

&> /dev/null
from the code to see it's output.

You do have curl,tee,sed,... installed on your system? Seeing the error you probably missing one of those... (check your output)
trixwood

Re: Denon AV Reciver - plugin

Post by trixwood »

try

Code: Select all

apt list --installed
or something simular that works in the pi

When not installed it probably goes like this:

Code: Select all

apt-get install tee sed grep
And are there any xml files downloaded in the same folder as you run your script?
cattoo
Posts: 60
Joined: Sunday 20 September 2015 17:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3072
Location: Sweden
Contact:

Re: Denon AV Reciver - plugin

Post by cattoo »

trixwood wrote:try

Code: Select all

apt list --installed
or something simular that works in the pi

When not installed it probably goes like this:

Code: Select all

apt-get install tee sed grep
And are there any xml files downloaded in the same folder as you run your script?
Tee is working, sed and grep are installed of what was listed in the installed stuff.
and there is now xml fil in the script folder.

I tried to run the script on my mac and it wokrked out just fine, most of it anyway so.
trixwood

Re: Denon AV Reciver - plugin

Post by trixwood »

I did make it for a mac :-) When I am home, I will try it on a pi.
Maybe post your xml.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest