GithubHelp home page GithubHelp logo

Comments (16)

Bono1969 avatar Bono1969 commented on July 22, 2024 1

Hi Jens,
i also have troubles with the conversion mapping.
On a Comet DECT Thermostat the mapping is:
0 -> Auto
1 -> OFF
2 -> ON

from iobroker.yahka.

nicoh88 avatar nicoh88 commented on July 22, 2024 1

With the current master you can try it with a custom conversion function (script).

I think, the problem from the issue owner is solved. Close

from iobroker.yahka.

jensweigele avatar jensweigele commented on July 22, 2024

I know that there are some issues with the HeatingCooling state.
Could you please check which value your "Control_Mode" state can have?
The Conversion currently does the following: (Homematic -> Homekit)
0 -> AUTO
1 -> HEAT
2 -> HEAT
3 -> HEAT
else -> OFF

from iobroker.yahka.

peterbaumert avatar peterbaumert commented on July 22, 2024

OK that explains it. Because even if its off control mode is still 1 :( maybe its possible to also include the set temperature? Because if its set to 4,5 that means its „OFF“

from iobroker.yahka.

jensweigele avatar jensweigele commented on July 22, 2024

Are you able to sketch out some kind of "specification"? I'm currently busy but if you give me some kind of mapping/process to map the values, I could maybe implement it

from iobroker.yahka.

schnub69 avatar schnub69 commented on July 22, 2024

OK that explains it. Because even if its off control mode is still 1 :( maybe its possible to also include the set temperature? Because if its set to 4,5 that means its „OFF“

Same here,

image

Mode OFF in Homekit sets to 0 = Auto Mode <-- this means not off --> off is manu mode below 4.5 °C
Mode Heating in Homekit sets to 1 = Manu Mode
Mode Cooling in Homekit sets to 0 = Auto Mode
Mode Automatic in Homekit sets to 0 = Auto Mode

any way to implement this?

from iobroker.yahka.

 avatar commented on July 22, 2024

Got the same struggle like @Bono1969

Hi Jens,
i also have troubles with the conversion mapping.
On a Comet DECT Thermostat the mapping is:
0 -> Auto
1 -> OFF
2 -> ON

Is there an easy way for different mapping?

from iobroker.yahka.

jensweigele avatar jensweigele commented on July 22, 2024

With the current master you can try it with a custom conversion function (script).

from iobroker.yahka.

 avatar commented on July 22, 2024

With the current master you can try it with a custom conversion function (script).

Ok, I got the workaround with two additional states (https://forum.iobroker.net/viewtopic.php?f=20&t=8187#p200509).
My Code is a little different and for DECT of course.

homekit yahka additional states

homekit yahka to dect

<xml xmlns="http://www.w3.org/1999/xhtml">
  <block type="on" id="ZE/S-9iNmQ6,jH5ldNTC" x="38" y="13">
    <field name="OID">fritzdect.0.Comet_117950531104.YAHKA-Input_to_DECT</field>
    <field name="CONDITION">ne</field>
    <field name="ACK_CONDITION"></field>
    <statement name="STATEMENT">
      <block type="controls_if" id="EFr6iA.DGMa*EGgjd,An">
        <mutation elseif="3"></mutation>
        <value name="IF0">
          <block type="logic_compare" id="w_co?|lraw]UCJn|c(,s">
            <field name="OP">EQ</field>
            <value name="A">
              <block type="variables_get" id="qc]sa(qT+d*B;8|o%7;j">
                <field name="VAR">value</field>
              </block>
            </value>
            <value name="B">
              <block type="math_number" id="H3QEAK?eXD}}Vt=mN:L]">
                <field name="NUM">0</field>
              </block>
            </value>
          </block>
        </value>
        <statement name="DO0">
          <block type="comment" id="1Ai1ke9)t`HU4[a-`q7x">
            <field name="COMMENT">AUS</field>
            <next>
              <block type="control" id="ONFjA/EgzBX2hJLrfVY6">
                <mutation delay_input="false"></mutation>
                <field name="OID">fritzdect.0.Comet_117950531104.mode</field>
                <field name="WITH_DELAY">FALSE</field>
                <value name="VALUE">
                  <block type="math_number" id="k!?lgrfj15y*}eBxIq`(">
                    <field name="NUM">1</field>
                  </block>
                </value>
              </block>
            </next>
          </block>
        </statement>
        <value name="IF1">
          <block type="logic_compare" id="9?vVqj.gndg?tmp[+@GW">
            <field name="OP">EQ</field>
            <value name="A">
              <block type="variables_get" id="DPt9V8w`|Ku[#E;7@*2F">
                <field name="VAR">value</field>
              </block>
            </value>
            <value name="B">
              <block type="math_number" id="*AB2t:ZX?dOLUsl`D7#8">
                <field name="NUM">1</field>
              </block>
            </value>
          </block>
        </value>
        <statement name="DO1">
          <block type="comment" id="fF,qImRNe*C`J@g9Lmy`">
            <field name="COMMENT">HEAT</field>
            <next>
              <block type="control" id="oeb}GlJFm~Wq^K99:tRA">
                <mutation delay_input="false"></mutation>
                <field name="OID">fritzdect.0.Comet_117950531104.mode</field>
                <field name="WITH_DELAY">FALSE</field>
                <value name="VALUE">
                  <block type="math_number" id="Tfj[)qH![}b#0;UiWB~/">
                    <field name="NUM">0</field>
                  </block>
                </value>
                <next>
                  <block type="control" id=")(gG=@A/8VS*?*?5=zR6">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">fritzdect.0.Comet_117950531104.targettemp</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                      <block type="math_number" id="H4W%sB]TxNE40v=MWd%0">
                        <field name="NUM">24</field>
                      </block>
                    </value>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </statement>
        <value name="IF2">
          <block type="logic_compare" id="?C[vDW6u9;KV9wY~:BQ7">
            <field name="OP">EQ</field>
            <value name="A">
              <block type="variables_get" id="R-6%mZLxF4n+K[-Vmtf7">
                <field name="VAR">value</field>
              </block>
            </value>
            <value name="B">
              <block type="math_number" id="6QOcWV[F2wnNisb|i%Pu">
                <field name="NUM">2</field>
              </block>
            </value>
          </block>
        </value>
        <statement name="DO2">
          <block type="comment" id="0)=Pc/AGjFbPST/0QL)Q">
            <field name="COMMENT">COOL</field>
            <next>
              <block type="control" id="P*q`C8.DpILun8CAS^;K">
                <mutation delay_input="false"></mutation>
                <field name="OID">fritzdect.0.Comet_117950531104.mode</field>
                <field name="WITH_DELAY">FALSE</field>
                <value name="VALUE">
                  <block type="math_number" id="dUjxVc-|}~Ez?W9S@W%@">
                    <field name="NUM">0</field>
                  </block>
                </value>
                <next>
                  <block type="control" id="(bV=6{F`V6_w,.#Fr4bp">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">fritzdect.0.Comet_117950531104.targettemp</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                      <block type="math_number" id="bTIciEb1bD99iE-T*Riv">
                        <field name="NUM">16</field>
                      </block>
                    </value>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </statement>
        <value name="IF3">
          <block type="logic_compare" id="+D(@!~?N0tDsn,RPEsSd">
            <field name="OP">EQ</field>
            <value name="A">
              <block type="variables_get" id="oF;h~;;..1Op6;AJ)3f6">
                <field name="VAR">value</field>
              </block>
            </value>
            <value name="B">
              <block type="math_number" id="*I,rWi-3N/JFH%R#[RHa">
                <field name="NUM">3</field>
              </block>
            </value>
          </block>
        </value>
        <statement name="DO3">
          <block type="comment" id="}MT*/6:P.EuqTFKV4i[U">
            <field name="COMMENT">AUTO</field>
            <next>
              <block type="control" id="c6/,KcWQB(J;=A3Sl5h@">
                <mutation delay_input="false"></mutation>
                <field name="OID">fritzdect.0.Comet_117950531104.mode</field>
                <field name="WITH_DELAY">FALSE</field>
                <value name="VALUE">
                  <block type="math_number" id="l(BY_)k/d%QdF!f7T])P">
                    <field name="NUM">0</field>
                  </block>
                </value>
              </block>
            </next>
          </block>
        </statement>
      </block>
    </statement>
  </block>
</xml>

homekit yahka from dect

<xml xmlns="http://www.w3.org/1999/xhtml">
  <block type="on" id="#ZW+c(RR#6LH%l}=oAKX" x="38" y="-62">
    <field name="OID">fritzdect.0.Comet_117950531104.mode</field>
    <field name="CONDITION">ne</field>
    <field name="ACK_CONDITION"></field>
    <statement name="STATEMENT">
      <block type="controls_if" id="mCHw%0*:TErPb{BLVZ6U">
        <mutation elseif="2"></mutation>
        <value name="IF0">
          <block type="logic_compare" id="BDOnoU:4iXPR(a`aKT*0">
            <field name="OP">EQ</field>
            <value name="A">
              <block type="variables_get" id="PNd5SxR.%q?#DndPHHCJ">
                <field name="VAR">value</field>
              </block>
            </value>
            <value name="B">
              <block type="math_number" id="k5y)lT~6um,,f~Z@o9Vk">
                <field name="NUM">0</field>
              </block>
            </value>
          </block>
        </value>
        <statement name="DO0">
          <block type="comment" id="j,P@rIUy9i9RBc]E=;li">
            <field name="COMMENT">AUTO</field>
            <next>
              <block type="control" id="Z0x3w]x36`@3y?D{s|:F">
                <mutation delay_input="false"></mutation>
                <field name="OID">fritzdect.0.Comet_117950531104.YAHKA-Mode_Output_from_DECT</field>
                <field name="WITH_DELAY">FALSE</field>
                <value name="VALUE">
                  <block type="math_number" id="Md]zCs_Y0A]EYwM_cPhx">
                    <field name="NUM">0</field>
                  </block>
                </value>
              </block>
            </next>
          </block>
        </statement>
        <value name="IF1">
          <block type="logic_compare" id="#{C}x3Xqevn:Y5|n;QH%">
            <field name="OP">EQ</field>
            <value name="A">
              <block type="variables_get" id="5AP)5@MCE)P#WIrSNiI#">
                <field name="VAR">value</field>
              </block>
            </value>
            <value name="B">
              <block type="math_number" id="?EI;Wl#l;wOz[j|NturJ">
                <field name="NUM">1</field>
              </block>
            </value>
          </block>
        </value>
        <statement name="DO1">
          <block type="comment" id="tR5XrK;4-freLw]kA3%,">
            <field name="COMMENT">COOL</field>
            <next>
              <block type="control" id=":Yc!_PE@MYSPXP_0L,.}">
                <mutation delay_input="false"></mutation>
                <field name="OID">fritzdect.0.Comet_117950531104.YAHKA-Mode_Output_from_DECT</field>
                <field name="WITH_DELAY">FALSE</field>
                <value name="VALUE">
                  <block type="math_number" id="~uR]cpikkzw}QR-j3VHi">
                    <field name="NUM">2</field>
                  </block>
                </value>
              </block>
            </next>
          </block>
        </statement>
        <value name="IF2">
          <block type="logic_compare" id="c-!rI7|frDnO7)%ADS/y">
            <field name="OP">EQ</field>
            <value name="A">
              <block type="variables_get" id="-1ZXMOol47?|H@m*7kaF">
                <field name="VAR">value</field>
              </block>
            </value>
            <value name="B">
              <block type="math_number" id="lGJ|9*?!_%gQKwvDYkYc">
                <field name="NUM">2</field>
              </block>
            </value>
          </block>
        </value>
        <statement name="DO2">
          <block type="comment" id="MXl1nN[F6zknL2kbTV36">
            <field name="COMMENT">HEAT</field>
            <next>
              <block type="control" id="oR|%;~5IS#Ka4!q+?{dY">
                <mutation delay_input="false"></mutation>
                <field name="OID">fritzdect.0.Comet_117950531104.YAHKA-Mode_Output_from_DECT</field>
                <field name="WITH_DELAY">FALSE</field>
                <value name="VALUE">
                  <block type="math_number" id="g8Jf;`i#@ln:+7I}d616">
                    <field name="NUM">1</field>
                  </block>
                </value>
              </block>
            </next>
          </block>
        </statement>
      </block>
    </statement>
  </block>
</xml>

from iobroker.yahka.

jensweigele avatar jensweigele commented on July 22, 2024

see also: https://forum.iobroker.net/viewtopic.php?f=20&t=8187&p=219501#p217610

from iobroker.yahka.

oklimberg avatar oklimberg commented on July 22, 2024

With the current master you can try it with a custom conversion function (script).

I know this is an old issue, but how can I read another value (current temperature) inside the custom conversion function?

And if I want to turn the thermostat off, I need to set 2 Values. Is this possible as well with the custom conversion function?

from iobroker.yahka.

kevinlieser avatar kevinlieser commented on July 22, 2024

@oklimberg Did you find a solution using other values inside the JS function?

from iobroker.yahka.

oklimberg avatar oklimberg commented on July 22, 2024

I think it is not really supported from what I found, but could be achievable.
All methods for reading and setting values work asynchronously using callbacks, whereas the conversion function has to return the converted value 'directly'.
I did not dig deep enough into the code to figure out if there is some elegant way to wait for the async methods to return before doing the conversion, like with future objects in Java.

You could use busy waiting with a while loop inside the conversion function using a boolean variable which will be set inside the async callback of the getter/setter but this is really ugly.

from iobroker.yahka.

kevinlieser avatar kevinlieser commented on July 22, 2024

Did you know the getter Fucntions? Did read something about getState() and setState() but this results in javascript error.

from iobroker.yahka.

oklimberg avatar oklimberg commented on July 22, 2024

You need to use this.adapter.setForeignState('ID-value', value, function (err) { }); and this.adapter.getForeignState('ID-value', function (err, state) { }); since the states you want to use are outside of the adapter. To read or set the temperature state of one of my thermostats I would have to use 'maxcube.0.devices.thermostat_XXXXX.temp'. You can find this under objects of ioBroker

from iobroker.yahka.

kevinlieser avatar kevinlieser commented on July 22, 2024

I got my problem solved by using an own data object for my Homekit Button and listening to changes by the JavaScript Adapter. On change I trigger the Homekit Button, on change the Homekit Button I trigger the Roomba/Denon AVR.

Seems to work.

Thanks!

from iobroker.yahka.

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.