• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Shelly device
#11
(08-24-2019, 04:34 PM)curlymo Wrote: That's probably because the first hit already sets the state of the device to up or down. The second hit is ignored because the status is already set.

Maybe you can build a rule that resets the status after each press.

Yes I think that is what happens. But that should be the special thing for shutters instead of the normal switch, that you can hit it again. Works for real shutters too.

Uli
 
Reply
#12
(08-25-2019, 09:15 AM)Ulrich.Arnold Wrote:
(08-24-2019, 04:34 PM)curlymo Wrote: That's probably because the first hit already sets the state of the device to up or down. The second hit is ignored because the status is already set.

Maybe you can build a rule that resets the status after each press.

Yes I think that is what happens. But that should be the special thing for shutters instead of the normal switch, that you can hit it again. Works for real shutters too.

Uli

Hi!
This is the relevant device part of the config.json

Code:
        "ShellyHofrolloRauf": {
            "protocol": [ "program" ],
            "id": [{
                "name": "ShellyHofrolloRauf"
            }],
            "program": "php /home/pi/ShellyAction.php",
            "arguments": "",
            "stop-command": "",
            "start-command": "php /home/pi/ShellyAction.php Hofrollo roller/0?go=open",
            "state": "stopped",
            "pid": 0
        },
        "ShellyHofrolloRunter": {
            "protocol": [ "program" ],
            "id": [{
                "name": "ShellyHofrolloRunterOff"
            }],
            "program": "php /home/pi/ShellyAction.php",
            "arguments": "",
            "stop-command": "",
            "start-command": "php /home/pi/ShellyAction.php Hofrollo roller/0?go=close",
            "state": "stopped",
            "pid": 0
        },
        "HofRollo": {
            "protocol": [ "generic_screen" ],
            "id": [{
                "id": 95
            }],
            "state": "up"
        },

and that is the relevant rule-part
Code:
        "HofrolloRauf": {
            "rule": "IF HofRollo.state == up THEN switch DEVICE ShellyHofrolloRauf TO running",
            "active": 1
        },
        "HofrolloRunter": {
            "rule": "IF HofRollo.state == down THEN switch DEVICE ShellyHofrolloRunter TO running",
            "active": 1
        },

and the script
Code:
<?php

printf( "ShellyAction.php Version 1.0.2 2019.08.24\n" );

//phpinfo();

if ( strpos( $argv[2], "roller" ) !== false )
{
    $url = "http://shelly-" . $argv[1] . ".fritz.box/roller/0";
    printf( "%s\n", $url );
    $response = file_get_contents( $url );
    printf( "1. Result=%s\n", $response );
    if ( strpos( $response, "\"state\":\"stop\"" ) === false )
    {
        $stop = "http://shelly-" . $argv[1] . ".fritz.box/roller/0?go=stop";
        printf( "2. %s\n", $stop );
        $response = file_get_contents( $stop );
        printf( "3. Result=%s\n", $response );
    }
    else
    {
        $url = "http://shelly-" . $argv[1] . ".fritz.box/" . $argv[2];
        printf( "4. %s\n", $url );
        $response = file_get_contents( $url );
        printf( "5. Result=%s\n", $response );
    }
}
else
{
    $url = "http://shelly-" . $argv[1] . ".fritz.box/" . $argv[2];
    printf( "%s\n", $url );
    $response = file_get_contents( $url );
    printf( "Result=%s\n", $response );
}

?>

I tried to reset the generic screen by
Code:
http://raspberrypi.fritz.box:5001/control?device=HofRollo&state=undefined
but only up and down are accepted.

The real screen-devices accept the second hit, but the rules seem to ignore the second hit, although the underlying device is a (generic) screen and not a switch

Uli
 
Reply
#13
Hi curlymo!

Do you have any (good) news regarding the shelly-integration? Is there anything I can do to help?

Uli
 
Reply
#14
No, still working on it. I haven't had a lot of time lately.
 
Reply
#15
I pushed the shelly and tasmota code.

Still working on the documentation and tests.

For now.

Devices:
Code:
        "devices": {
                "living": {
                        "protocol": [ "shelly1" ],
                        "id": [{
                                "id": "XX00YY00"
                        }],
                        "state": "on"
                },
                "washingmachine": {
                        "protocol": [ "shelly1pm" ],
                        "id": [{
                                "id": "XX00YY00"
                        }],
                        "state": "on",
                        "energy": 0,
                        "power": 0,
                        "overtemperature": 0,
                        "temperature": 43.33
                },
                "light": {
                        "protocol": [ "tasmota_switch" ],
                        "id": [{
                                "id": "sonoff"
                        }],
                        "state": "off"
                }
        }

Hardware:
Code:
        "hardware": {
                "mqtt": {},
                "shelly": {},
                "tasmota": {},
                "433gpio": {
                        "sender": 0,
                        "receiver": 1
                }
        }

In both devices, enable MQTT and set the IP to the pilight instance.
 
Reply
#16
Thumbs Up 
(09-26-2019, 02:03 PM)curlymo Wrote: I pushed the shelly and tasmota code.

Still working on the documentation and tests.

Hi curlymo!

Sounds very good. Unfortunately I will be away for some days. Will test it ASAP

Uli
 
Reply
#17
Hi curlymo

I'm back today and wanted to test the shelly-integration. But apt-cache shows only stable but no nightly releases

Uli
 
Reply
#18
Did you add the staging repository?
 
Reply
#19
(10-06-2019, 10:17 AM)curlymo Wrote: Did you add the staging repository?

Yes I have "nightly main" as in the manual. Or did the name change?

Uli
 
Reply
#20
You're right. It seems that the armhf builds fail someone. The other builds are compiled.



I've updated the repositories again.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  re-recognition of device sending signals n0l0cale 1 560 02-21-2019, 12:30 PM
Last Post: TerryLewis

Forum Jump:


Browsing: 1 Guest(s)