[Solved] My first system

Discussions about Z-Way software and Z-Wave technology in general
cpighin
Posts: 64
Joined: 04 Mar 2015 18:21
Location: Ciampino (RM)

Re: [Solved] My first system

Post by cpighin » 10 May 2015 20:39

:) Thanks Andrea for your contribution.

If I have not misunderstood, your script performs almost the same function as the 2 LogicalRules that I implemented, but does so with a different tool.

Because I'm ignorant in this field, how I could use the files that you posted with your attachment?

Claudio :)

ilcato
Posts: 5
Joined: 08 May 2015 22:52

Re: [Solved] My first system

Post by ilcato » 14 May 2015 01:10

1. Put the unzipped folder with the 2 files within the userModules folder of the z-way server (default is: /opt/z-way-server/automation/userModules)
2. Stop the z-way server (sudo /etc/init.d/z-way-server stop)
3. Start the z-way server (sudo /etc/init.d/z-way-server start)
4. Look for a new automation module through the preferences panel within the HA UI

Andrea

cpighin
Posts: 64
Joined: 04 Mar 2015 18:21
Location: Ciampino (RM)

Re: [Solved] My first system

Post by cpighin » 15 May 2015 10:25

:) Andrea,

I followed your instructions:
- I started my RPI2,
- I used the file manager to copy the folder AutoOffSmart containing the two files index.js and module.json in /opt/z-way-server/automation/userModules,
- I stopped and restarted the server Z-way with the commands:

Code: Select all

sudo /etc/init.d/z-way-server stop
sudo /etc/init.d/z-way-server start
- I opened the HA interface UI and did not find the new module in the path Preferences > Automation, as expected.

Where did I go wrong?

Claudio :)

ilcato
Posts: 5
Joined: 08 May 2015 22:52

Re: [Solved] My first system

Post by ilcato » 16 May 2015 08:43

try to put it in modules instead of userModules.

cpighin
Posts: 64
Joined: 04 Mar 2015 18:21
Location: Ciampino (RM)

Re: [Solved] My first system

Post by cpighin » 16 May 2015 15:55

:) Andrea,

I tried to move the folder AUtoOffSmart from /opt/z-way-server/automation/userModules to /opt/z-way-server/automation/modules without achieving the desired result. I then moved it back to the initial position.

This surprised me because a few days ago I complained that the old warnings were not removed due to a bug in the system and I was sure to find them into the dashborad along with any new ones. Surprisingly there was only one, this:

Code: Select all

Type: core
Timestamp: 16/05/15-14:13
Message:
Can not load modules.json from userModules/AutoOffSmart/module.json: SyntaxError: Unexpected token “
I told myself that it is not true that the old warning are not removed.
Can a Z-way expert clarify this point?

I am not savvy enough to figure out what to do, but I sense that the warning was generated as a result of the move of the folder in the folder AutoOffSmart userModules and may be due to a syntax error in the file module.json.

Comments?

Claudio :)

ilcato
Posts: 5
Joined: 08 May 2015 22:52

Re: [Solved] My first system

Post by ilcato » 16 May 2015 16:27

There was an error in the file. Try with the one attached.
Andrea
Attachments
AutoOffSmart.zip
(3.69 KiB) Downloaded 101 times

cpighin
Posts: 64
Joined: 04 Mar 2015 18:21
Location: Ciampino (RM)

Re: [Solved] My first system

Post by cpighin » 16 May 2015 22:20

Andrea,

I inserted the new folder with the file you modified in /opt/z-way-server/automation/userModules and I got the following warning:

Code: Select all

Type: core
Timestamp: 16/05/15-20:17
Message:
Can not load modules.json from userModules/AutoOffSmart/module.json: SyntaxError: Unexpected token “
while the previous one was not present.

I noticed in the timestamp 20:17 while my pc was reporting 21:17.

Claudio :)

ilcato
Posts: 5
Joined: 08 May 2015 22:52

Re: [Solved] My first system

Post by ilcato » 16 May 2015 23:40

Be sure to download the latest zip file. The error you receive is exactly the one I corrected: there was a “ character instead of ".
It works for me.
Andrea

cpighin
Posts: 64
Joined: 04 Mar 2015 18:21
Location: Ciampino (RM)

Re: [Solved] My first system

Post by cpighin » 17 May 2015 15:08

Andea,

what follows is the current contents of file module.json, located in the folder x
/opt/z-way-server/automation/userModules

Code: Select all

{
    "singleton": false,
    "dependencies": [],
    "category": "scheduling",
    "author": "ilcato",
    "homepage": "",
    "icon": "",
    "version": "1.0",
    "maturity": "stable",
    "repository": {
            "type": "",
            "source": ""
    },
    "defaults": {
        "title": "Auto Off Smart",
        "description": "Automatically turn of devices after N seconds only if the controlling sensor is off",
        "timeout": 5,
        "device": ""
    },
    "schema": {
        "description": "Automatically turn of devices after N seconds only if the controlling sensor is off",
        "type": "object",
        "properties": {
            "device": {
                "field": "enum",
                "datasource": "namespaces",
                "enum": "namespaces:devices_switchBinary:deviceId,namespaces:devices_switchMultilevel:deviceId",
                "required": true
            },
            "controllingDevice": {
                "field": "enum",
                "datasource": "namespaces",
                "enum": "namespaces:devices_sensorBinary:deviceId",
                "required": true
            },
            "timeout": {
                "type": "number",
                "required": true
            }
        },
        "required": false
    },
    "options": {
        "fields": {
            "device": {
                "label": "The device to be turned off after the timeout",
                "datasource": "namespaces",
                "field": "optionLabels",
                "optionLabels": "namespaces:devices_switchBinary:deviceName,namespaces:devices_switchMultilevel:deviceName"
            },
            "controllingDevice": {
                "label": "The binary sensor that control the device",
                "datasource": "namespaces",
                "field": "optionLabels",
                "optionLabels": "namespaces:devices_sensorBinary:deviceName"
            },
            "timeout": {
                "label": "Timeout in seconds"
            }
        }
    }
}
Now in the dashboard I see the previous warning and the new one:

Code: Select all

[CORE] Can not load modules.json from userModules/AutoOffSmart/module.json: SyntaxError: Unexpected token “
Type: core
Timestamp: 17/05/15-14:31
Message:
Can not create vDev based on 2-0-48: TypeError: Cannot read property 'get' of undefined
Additional Note: few minutes ago I changed battery to my Multisensor device!

Claudio :)

cpighin
Posts: 64
Joined: 04 Mar 2015 18:21
Location: Ciampino (RM)

Re: [Solved] My first system

Post by cpighin » 18 May 2015 08:58

Andrea,

here attached the content of the final part of the file /var/log/z-way-server.log of my raspberry (since this morning I started and restarted a couple of times the Raspi).

The warnings have not changed (are the three previously reported)

ecco in allegato il contenuto dellla parte finale del file /var/log/z-way-server.log del raspberry (da quando questa mattina ho avviato e riavviato un paio di volte il Raspi).

Gli warnings non sono cambiati (sono i 3 già riportati)

Claudio :)
Attachments
z-way-server.log.zip
(23.29 KiB) Downloaded 107 times

Post Reply